mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
proposed enhancement #4830
This commit is contained in:
parent
96c5605374
commit
e368ac21ef
@ -1578,6 +1578,7 @@
|
||||
\protected\def\sphinxtablecontinued#1{\textsf{#1}}
|
||||
\protected\def\sphinxtitleref#1{\emph{#1}}
|
||||
\protected\def\sphinxmenuselection#1{\emph{#1}}
|
||||
\protected\def\sphinxguilabel#1{\emph{#1}}
|
||||
\protected\def\sphinxaccelerator#1{\underline{#1}}
|
||||
\protected\def\sphinxcrossref#1{\emph{#1}}
|
||||
\protected\def\sphinxtermref#1{\emph{#1}}
|
||||
|
@ -2409,9 +2409,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
def visit_inline(self, node):
|
||||
# type: (nodes.Node) -> None
|
||||
classes = node.get('classes', [])
|
||||
if classes in [['menuselection'], ['guilabel']]:
|
||||
if classes in [['menuselection']]:
|
||||
self.body.append(r'\sphinxmenuselection{')
|
||||
self.context.append('}')
|
||||
elif classes in [['guilabel']]:
|
||||
self.body.append(r'\sphinxguilabel{')
|
||||
self.context.append('}')
|
||||
elif classes in [['accelerator']]:
|
||||
self.body.append(r'\sphinxaccelerator{')
|
||||
self.context.append('}')
|
||||
|
@ -162,12 +162,20 @@ def get_verifier(verify, verify_re):
|
||||
'\\sphinxmenuselection{a \\(\\rightarrow\\) b}',
|
||||
),
|
||||
(
|
||||
# interpolation of ampersands in guilabel/menuselection
|
||||
# interpolation of ampersands in menuselection
|
||||
'verify',
|
||||
':menuselection:`&Foo -&&- &Bar`',
|
||||
(u'<p><span class="menuselection"><span class="accelerator">F</span>oo '
|
||||
'-&- <span class="accelerator">B</span>ar</span></p>'),
|
||||
r'\sphinxmenuselection{\sphinxaccelerator{F}oo -\&- \sphinxaccelerator{B}ar}',
|
||||
),
|
||||
(
|
||||
# interpolation of ampersands in guilabel
|
||||
'verify',
|
||||
':guilabel:`&Foo -&&- &Bar`',
|
||||
(u'<p><span class="guilabel"><span class="accelerator">F</span>oo '
|
||||
'-&- <span class="accelerator">B</span>ar</span></p>'),
|
||||
r'\sphinxmenuselection{\sphinxaccelerator{F}oo -\&- \sphinxaccelerator{B}ar}',
|
||||
r'\sphinxguilabel{\sphinxaccelerator{F}oo -\&- \sphinxaccelerator{B}ar}',
|
||||
),
|
||||
(
|
||||
# non-interpolation of dashes in option role
|
||||
|
Loading…
Reference in New Issue
Block a user