mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1987: Fix ampersand is ignored in `:menuselection:
and
:guilabel:
` on LaTeX builder
This commit is contained in:
parent
5be5b057a9
commit
2c5c54aa67
1
CHANGES
1
CHANGES
@ -52,6 +52,7 @@ Bugs fixed
|
|||||||
* #1540: Fix RuntimeError with circular referenced toctree
|
* #1540: Fix RuntimeError with circular referenced toctree
|
||||||
* #1983: i18n translation feature breaks references which uses section name.
|
* #1983: i18n translation feature breaks references which uses section name.
|
||||||
* #1990: Use caption of toctree to title of \tableofcontents in LaTeX
|
* #1990: Use caption of toctree to title of \tableofcontents in LaTeX
|
||||||
|
* #1987: Fix ampersand is ignored in ``:menuselection:`` and ``:guilabel:`` on LaTeX builder
|
||||||
|
|
||||||
|
|
||||||
Release 1.3.1 (released Mar 17, 2015)
|
Release 1.3.1 (released Mar 17, 2015)
|
||||||
|
@ -1713,6 +1713,9 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
if classes in [['menuselection'], ['guilabel']]:
|
if classes in [['menuselection'], ['guilabel']]:
|
||||||
self.body.append(r'\emph{')
|
self.body.append(r'\emph{')
|
||||||
self.context.append('}')
|
self.context.append('}')
|
||||||
|
elif classes in [['accelerator']]:
|
||||||
|
self.body.append(r'\underline{')
|
||||||
|
self.context.append('}')
|
||||||
elif classes and not self.in_title:
|
elif classes and not self.in_title:
|
||||||
self.body.append(r'\DUspan{%s}{' % ','.join(classes))
|
self.body.append(r'\DUspan{%s}{' % ','.join(classes))
|
||||||
self.context.append('}')
|
self.context.append('}')
|
||||||
|
@ -109,7 +109,7 @@ def test_inline():
|
|||||||
yield (verify, ':guilabel:`&Foo -&&- &Bar`',
|
yield (verify, ':guilabel:`&Foo -&&- &Bar`',
|
||||||
u'<p><span class="guilabel"><span class="accelerator">F</span>oo '
|
u'<p><span class="guilabel"><span class="accelerator">F</span>oo '
|
||||||
'-&- <span class="accelerator">B</span>ar</span></p>',
|
'-&- <span class="accelerator">B</span>ar</span></p>',
|
||||||
r'\emph{\DUspan{accelerator}{F}oo -\&- \DUspan{accelerator}{B}ar}')
|
r'\emph{\underline{F}oo -\&- \underline{B}ar}')
|
||||||
|
|
||||||
# non-interpolation of dashes in option role
|
# non-interpolation of dashes in option role
|
||||||
yield (verify_re, ':option:`--with-option`',
|
yield (verify_re, ':option:`--with-option`',
|
||||||
|
Loading…
Reference in New Issue
Block a user