Skip to content

Commit

Permalink
Fix lookup table for multi-word key names (kbd role) (#10962)
Browse files Browse the repository at this point in the history
It seems the original PR adding multi word key support forgot to add
commas and python helpfully just concatenated the strings instead of
building the required tuples.
  • Loading branch information
textshell committed Dec 30, 2022
1 parent b91f661 commit aa2fa38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sphinx/builders/html/transforms.py
Expand Up @@ -31,12 +31,12 @@ class KeyboardTransform(SphinxPostTransform):
formats = ('html',)
pattern = re.compile(r'(?<=.)(-|\+|\^|\s+)(?=.)')
multiwords_keys = (('caps', 'lock'),
('page' 'down'),
('page', 'down'),
('page', 'up'),
('scroll' 'lock'),
('scroll', 'lock'),
('num', 'lock'),
('sys' 'rq'),
('back' 'space'))
('sys', 'rq'),
('back', 'space'))

def run(self, **kwargs: Any) -> None:
matcher = NodeMatcher(nodes.literal, classes=["kbd"])
Expand Down

0 comments on commit aa2fa38

Please sign in to comment.