diff options
author | Georg Brandl <georg@python.org> | 2008-04-27 19:53:27 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-04-27 19:53:27 +0000 |
commit | 20b6be23e9f913fe5595b24c0081f7d6f62bd9f9 (patch) | |
tree | 7c6133203f91ad2c539b1f99718081f9a39bc803 /sphinx/htmlwriter.py | |
parent | 262edb1413bbe1345219d15af69bd0b24395393d (diff) | |
download | sphinx-git-20b6be23e9f913fe5595b24c0081f7d6f62bd9f9.tar.gz |
Fix a bug where smartypants was used for attribute values.
Diffstat (limited to 'sphinx/htmlwriter.py')
-rw-r--r-- | sphinx/htmlwriter.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sphinx/htmlwriter.py b/sphinx/htmlwriter.py index 8767f73f8..94b3cdb51 100644 --- a/sphinx/htmlwriter.py +++ b/sphinx/htmlwriter.py @@ -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) |