Fix :samp: latex tests.

This commit is contained in:
Georg Brandl
2011-09-21 10:05:37 +02:00
parent 9088433491
commit 5d936d5ff1
2 changed files with 5 additions and 3 deletions

View File

@@ -1469,7 +1469,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.verbatim += node.astext()
else:
text = self.encode(node.astext())
self.body.append(educate_quotes_latex(text))
if not self.no_contractions:
text = educate_quotes_latex(text)
self.body.append(text)
def depart_Text(self, node):
pass

View File

@@ -84,14 +84,14 @@ def test_inline():
_html = ('<p><tt class="(samp )?docutils literal"><span class="pre">'
'code</span>&nbsp;&nbsp; <span class="pre">sample</span></tt></p>')
yield verify_re, '``code sample``', _html, r'\\code{code sample}'
yield verify_re, ':samp:`code sample`', _html, r'\\samp{code sample}'
yield verify_re, ':samp:`code sample`', _html, r'\\code{code sample}'
# interpolation of braces in samp and file roles (HTML only)
yield (verify, ':samp:`a{b}c`',
'<p><tt class="samp docutils literal"><span class="pre">a</span>'
'<em><span class="pre">b</span></em>'
'<span class="pre">c</span></tt></p>',
'\\samp{abc}')
'\\code{a\\emph{b}c}')
# interpolation of arrows in menuselection
yield (verify, ':menuselection:`a --> b`',