Georg Brandl avatar Georg Brandl committed c4b266b

Closes #647: Do not apply SmartyPants in parsed-literal blocks.

Comments (0)

Files changed (2)

 Release 1.0.8 (in development)
 ==============================
 
+* #647: Do not apply SmartyPants in parsed-literal blocks.
+
 
 Release 1.0.7 (Jan 15, 2011)
 ============================

sphinx/writers/html.py

         self.no_smarty += 1
         try:
             HTMLTranslator.visit_literal_block(self, node)
-        finally:
+        except nodes.SkipNode:
+            # HTMLTranslator raises SkipNode for simple literal blocks,
+            # but not for parsed literal blocks
             self.no_smarty -= 1
+            raise
+
+    def depart_literal_block(self, node):
+        HTMLTranslator.depart_literal_block(self, node)
+        self.no_smarty -= 1
 
     def visit_literal_emphasis(self, node):
         self.no_smarty += 1
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.