Commit ecb5f4c6 authored by Jacob Kaplan-Moss's avatar Jacob Kaplan-Moss
Browse files

Fixed the documentation HTML writer to not apply smartypants to literal...

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
parent b13276b1
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -89,6 +89,17 @@ class DjangoHTMLTranslator(sphinx.htmlwriter.SmartyPantsHTMLTranslator):
        self.body.append(')')
        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,