mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6845 from jfbu/latex_do_not_escape_verticalbarchar
LaTeX: stop escaping | to LaTeX macro, except if in an index entry
This commit is contained in:
commit
9f7c7a34db
@ -35,8 +35,6 @@ tex_replacements = [
|
||||
('`', r'{}`'),
|
||||
('<', r'\textless{}'),
|
||||
('>', r'\textgreater{}'),
|
||||
# map char for some unknown reason. TODO: remove this?
|
||||
('|', r'\textbar{}'),
|
||||
# map special Unicode characters to TeX commands
|
||||
('✓', r'\(\checkmark\)'),
|
||||
('✔', r'\(\pmb{\checkmark}\)'),
|
||||
|
@ -1816,6 +1816,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
value = value.replace('"', '""')
|
||||
value = value.replace('@', '"@')
|
||||
value = value.replace('!', '"!')
|
||||
value = value.replace('|', r'\textbar{}')
|
||||
return value
|
||||
|
||||
def style(string):
|
||||
|
@ -315,7 +315,7 @@ def test_numref_with_prefix2(app, status, warning):
|
||||
assert ('\\hyperref[\\detokenize{baz:table22}]'
|
||||
'{Table:\\ref{\\detokenize{baz:table22}}}') in result
|
||||
assert ('\\hyperref[\\detokenize{index:code-1}]{Code-\\ref{\\detokenize{index:code-1}} '
|
||||
'\\textbar{} }') in result
|
||||
'| }') in result
|
||||
assert ('\\hyperref[\\detokenize{baz:code22}]'
|
||||
'{Code-\\ref{\\detokenize{baz:code22}}}') in result
|
||||
assert ('\\hyperref[\\detokenize{foo:foo}]'
|
||||
|
Loading…
Reference in New Issue
Block a user