Commits

Georg Brandl  committed 41cb9d2

#299: Fix the mangling of quotes in "include:: :literal:" blocks.

  • Participants
  • Parent commits 927602b

Comments (0)

Files changed (5)

 Release 0.6.4 (in development)
 ==============================
 
+* #299: Fix the mangling of quotes in some literal blocks.
+
 * #292: Fix path to the search index for the ``dirhtml`` builder.
 
 * Fix a Jython compatibility issue: make the dependence on the

File sphinx/writers/html.py

         finally:
             self.no_smarty -= 1
 
+    def visit_literal_block(self, node):
+        self.no_smarty += 1
+
+    def depart_literal_block(self, node):
+        self.no_smarty -= 1
+
     def visit_literal_emphasis(self, node):
         self.no_smarty += 1
         self.visit_emphasis(node)

File tests/root/includes.txt

 .. cssclass:: inc-pyobj-dedent
 .. literalinclude:: literal.inc
    :pyobject: Bar.baz
+
+Docutils include with "literal"
+===============================
+
+While not recommended, it should work (and leave quotes alone).
+
+.. include:: quotes.inc
+   :literal:
+   :tab-width: 4

File tests/root/quotes.inc

+Testing "quotes" in literal 'included' text.

File tests/test_build.py

         ".//pre": u'Max Strauß',
         ".//a[@href='_downloads/img.png']": '',
         ".//a[@href='_downloads/img1.png']": '',
+        ".//pre": u'"quotes"',
+        ".//pre": u"'included'",
     },
     'autodoc.html': {
         ".//dt[@id='test_autodoc.Class']": '',