diff options
author | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2022-06-01 20:10:55 +0300 |
---|---|---|
committer | Adam Turner <9087854+AA-Turner@users.noreply.github.com> | 2022-06-01 20:10:55 +0300 |
commit | efdbe06eea67cba57532160a1eb80aaac2241d50 (patch) | |
tree | 239d011dbe62068699bf3fbf7052bd44175eec0d | |
parent | 91f90a5fb5c7c4e412d966582266f20bbadd46d2 (diff) |
Review comments
-rw-r--r-- | sphinx/builders/html/transforms.py | 3 | ||||
-rw-r--r-- | tests/test_transforms_post_transforms.py | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/sphinx/builders/html/transforms.py b/sphinx/builders/html/transforms.py index 940b0c0d8..1ba6ba857 100644 --- a/sphinx/builders/html/transforms.py +++ b/sphinx/builders/html/transforms.py @@ -42,8 +42,7 @@ class KeyboardTransform(SphinxPostTransform): matcher = NodeMatcher(nodes.literal, classes=["kbd"]) # this list must be pre-created as during iteration new nodes # are added which match the condition in the NodeMatcher. - nodes_to_expand: List[nodes.literal] = list(self.document.findall(matcher)) - for node in nodes_to_expand: # type: nodes.literal + for node in list(self.document.findall(matcher)): # type: nodes.literal parts = self.pattern.split(node[-1].astext()) if len(parts) == 1 or self.is_multiwords_key(parts): continue diff --git a/tests/test_transforms_post_transforms.py b/tests/test_transforms_post_transforms.py index ebd505776..215e6d14f 100644 --- a/tests/test_transforms_post_transforms.py +++ b/tests/test_transforms_post_transforms.py @@ -52,7 +52,7 @@ def test_missing_reference_conditional_pending_xref(app, status, warning): @pytest.mark.sphinx('html', testroot='transforms-post_transforms-keyboard', freshenv=True) -def test_keyboard_issue_10495(app): +def test_keyboard_hyphen_spaces(app): """Regression test for issue 10495, we want no crash.""" app.build() assert "spanish" in (app.outdir / 'index.html').read_text(encoding='utf8') |