diff options
-rw-r--r-- | sandbox/py-rest-doc/sphinx/smartypants.py | 9 | ||||
-rw-r--r-- | sandbox/py-rest-doc/sphinx/writer.py | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/sandbox/py-rest-doc/sphinx/smartypants.py b/sandbox/py-rest-doc/sphinx/smartypants.py index bf8ed0dcb..0264a4299 100644 --- a/sandbox/py-rest-doc/sphinx/smartypants.py +++ b/sandbox/py-rest-doc/sphinx/smartypants.py @@ -547,6 +547,15 @@ def smartyPants(text, attr=default_smartypants_attr): return "".join(result) +def sphinx_smarty_pants(t): + t = educateDashesOldSchool(t) + # Note: backticks need to be processed before quotes. + t = educateBackticks(t) + t = educateSingleBackticks(t) + t = educateQuotes(t) + return t + + def educateQuotes(str): """ Parameter: String. diff --git a/sandbox/py-rest-doc/sphinx/writer.py b/sandbox/py-rest-doc/sphinx/writer.py index d77418d69..e04951de3 100644 --- a/sandbox/py-rest-doc/sphinx/writer.py +++ b/sandbox/py-rest-doc/sphinx/writer.py @@ -12,7 +12,7 @@ from docutils import nodes from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator -from .smartypants import smartyPants +from .smartypants import sphinx_smarty_pants class HTMLWriter(Writer): @@ -210,5 +210,5 @@ class SmartyPantsHTMLTranslator(HTMLTranslator): def encode(self, text): text = HTMLTranslator.encode(self, text) if self.no_smarty <= 0: - text = smartyPants(text, "qBD") + text = sphinx_smarty_pants(text) return text |