mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
#299: Fix the mangling of quotes in "include:: :literal:" blocks.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
1
tests/root/quotes.inc
Normal file
@@ -0,0 +1 @@
|
||||
Testing "quotes" in literal 'included' text.
|
||||
@@ -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']": '',
|
||||
|
||||
Reference in New Issue
Block a user