Permalink
Browse files

Fixed the documentation HTML writer to not apply smartypants to liter…

…al blocks. Fixes #8696; thanks, ramiro.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8875 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent b13276b commit ecb5f4c6930b08fd91faa1c112eb210d8ca04902 @jacobian jacobian committed Sep 2, 2008
Showing with 11 additions and 0 deletions.
  1. +11 −0 docs/_ext/djangodocs.py
View
@@ -90,6 +90,17 @@ def depart_desc_parameterlist(self, node):
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.

0 comments on commit ecb5f4c

Please sign in to comment.