mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX writer: leave `"
` character inside parsed-literal as is
This commit is contained in:
parent
234379be9e
commit
02fada9124
@ -355,6 +355,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
self.this_is_the_title = 1
|
||||
self.literal_whitespace = 0
|
||||
self.no_contractions = 0
|
||||
self.is_parsed_literal = 0
|
||||
self.compact_list = 0
|
||||
self.first_param = 0
|
||||
self.remember_multirow = {}
|
||||
@ -1927,6 +1928,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
def visit_literal_block(self, node):
|
||||
if node.rawsource != node.astext():
|
||||
# most probably a parsed-literal block -- don't highlight
|
||||
self.is_parsed_literal +=1
|
||||
self.body.append('\\begin{alltt}\n')
|
||||
else:
|
||||
ids = ''
|
||||
@ -1988,6 +1990,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
|
||||
def depart_literal_block(self, node):
|
||||
self.body.append('\n\\end{alltt}\n')
|
||||
self.is_parsed_literal -=1
|
||||
visit_doctest_block = visit_literal_block
|
||||
depart_doctest_block = depart_literal_block
|
||||
|
||||
@ -2190,7 +2193,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
|
||||
def visit_Text(self, node):
|
||||
text = self.encode(node.astext())
|
||||
if not self.no_contractions:
|
||||
if not self.no_contractions and not self.is_parsed_literal:
|
||||
text = educate_quotes_latex(text)
|
||||
self.body.append(text)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user