diff options
author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-02 19:49:23 +0000 |
---|---|---|
committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-02 19:49:23 +0000 |
commit | ecb5f4c6930b08fd91faa1c112eb210d8ca04902 (patch) | |
tree | 568114fccdfbf7362f265bb1150d817dc153434f /docs/_ext/djangodocs.py | |
parent | b13276b1ffab0abdf73aca5681fbe7dca0bf3663 (diff) | |
download | django-ecb5f4c6930b08fd91faa1c112eb210d8ca04902.tar.gz |
Fixed the documentation HTML writer to not apply smartypants to literal blocks. Fixes #8696; thanks, ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/_ext/djangodocs.py')
-rw-r--r-- | docs/_ext/djangodocs.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py index 560cae7ac7..5640016502 100644 --- a/docs/_ext/djangodocs.py +++ b/docs/_ext/djangodocs.py @@ -90,6 +90,17 @@ class DjangoHTMLTranslator(sphinx.htmlwriter.SmartyPantsHTMLTranslator): pass # + # Don't apply smartypants to literal blocks + # + def visit_literal_block(self, node): + self.no_smarty += 1 + sphinx.htmlwriter.SmartyPantsHTMLTranslator.visit_literal_block(self, node) + + def depart_literal_block(self, node): + sphinx.htmlwriter.SmartyPantsHTMLTranslator.depart_literal_block(self, node) + self.no_smarty -= 1 + + # # Turn the "new in version" stuff (versoinadded/versionchanged) into a # better callout -- the Sphinx default is just a little span, # which is a bit less obvious that I'd like. |