mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3960: default_role = guilabel not functioning
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -21,7 +21,8 @@ Bugs fixed
|
||||
|
||||
* #3924: docname lost after dynamically parsing RST in extension
|
||||
* #3946: Typo in sphinx.sty (this was a bug with no effect in default context)
|
||||
* Fix :pep: and :rfc: does not supports ``default-role`` directive (refs: #3960)
|
||||
* :pep: and :rfc: does not supports ``default-role`` directive (refs: #3960)
|
||||
* #3960: default_role = 'guilabel' not functioning
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
@@ -189,6 +189,7 @@ def indexmarkup_role(typ, rawtext, text, lineno, inliner, options={}, content=[]
|
||||
typ = env.temp_data['default_role'].lower()
|
||||
else:
|
||||
typ = typ.lower()
|
||||
|
||||
has_explicit_title, title, target = split_explicit_title(text)
|
||||
title = utils.unescape(title)
|
||||
target = utils.unescape(target)
|
||||
@@ -250,6 +251,13 @@ _amp_re = re.compile(r'(?<!&)&(?![&\s])')
|
||||
|
||||
def menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||
# type: (unicode, unicode, unicode, int, Inliner, Dict, List[unicode]) -> Tuple[List[nodes.Node], List[nodes.Node]] # NOQA
|
||||
env = inliner.document.settings.env
|
||||
if not typ:
|
||||
assert env.temp_data['default_role']
|
||||
typ = env.temp_data['default_role'].lower()
|
||||
else:
|
||||
typ = typ.lower()
|
||||
|
||||
text = utils.unescape(text)
|
||||
if typ == 'menuselection':
|
||||
text = text.replace('-->', u'\N{TRIANGULAR BULLET}')
|
||||
@@ -281,6 +289,13 @@ _litvar_re = re.compile('{([^}]+)}')
|
||||
def emph_literal_role(typ, rawtext, text, lineno, inliner,
|
||||
options={}, content=[]):
|
||||
# type: (unicode, unicode, unicode, int, Inliner, Dict, List[unicode]) -> Tuple[List[nodes.Node], List[nodes.Node]] # NOQA
|
||||
env = inliner.document.settings.env
|
||||
if not typ:
|
||||
assert env.temp_data['default_role']
|
||||
typ = env.temp_data['default_role'].lower()
|
||||
else:
|
||||
typ = typ.lower()
|
||||
|
||||
text = utils.unescape(text)
|
||||
pos = 0
|
||||
retnode = nodes.literal(role=typ.lower(), classes=[typ])
|
||||
|
||||
Reference in New Issue
Block a user