mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix a bug where smartypants was used for attribute values.
This commit is contained in:
parent
262edb1413
commit
20b6be23e9
2
CHANGES
2
CHANGES
@ -91,6 +91,8 @@ Bugs fixed
|
||||
|
||||
* sphinx.htmlwriter: Don't use os.path for joining image HREFs.
|
||||
|
||||
* sphinx.htmlwriter: Don't use SmartyPants for HTML attribute values.
|
||||
|
||||
* sphinx.latexwriter: Implement option lists. Also, some other changes
|
||||
were made to ``sphinx.sty`` in order to enhance compatibility and
|
||||
remove old unused stuff. Thanks to Gael Varoquaux for that!
|
||||
|
@ -351,8 +351,11 @@ class SmartyPantsHTMLTranslator(HTMLTranslator):
|
||||
finally:
|
||||
self.no_smarty -= 1
|
||||
|
||||
def encode(self, text):
|
||||
text = HTMLTranslator.encode(self, text)
|
||||
if self.no_smarty <= 0:
|
||||
text = sphinx_smarty_pants(text)
|
||||
return text
|
||||
def visit_Text(self, node):
|
||||
text = node.astext()
|
||||
encoded = self.encode(text)
|
||||
if self.in_mailto and self.settings.cloak_email_addresses:
|
||||
encoded = self.cloak_email(encoded)
|
||||
elif self.no_smarty <= 0:
|
||||
encoded = sphinx_smarty_pants(encoded)
|
||||
self.body.append(encoded)
|
||||
|
Loading…
Reference in New Issue
Block a user