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

This commit is contained in:
Georg Brandl
2009-12-24 13:19:07 +01:00
parent 64c534b03b
commit 88e54f951b
5 changed files with 20 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
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

View File

@@ -501,6 +501,12 @@ class SmartyPantsHTMLTranslator(HTMLTranslator):
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)

View File

@@ -51,3 +51,12 @@ Test if dedenting before parsing works.
.. 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

1
tests/root/quotes.inc Normal file
View File

@@ -0,0 +1 @@
Testing "quotes" in literal 'included' text.

View File

@@ -77,6 +77,8 @@ HTML_XPATH = {
".//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']": '',