diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-07-07 02:09:50 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 02:09:50 +0900 |
commit | 5e5bca98f752cb61c36afc7955183e79a6095cf2 (patch) | |
tree | 66fc9448a4bbab736469fdad514dfa970787d495 /sphinx/writers/manpage.py | |
parent | 988a79de65737e403cd27721ce091760cf62b97f (diff) | |
parent | f0fef96906d80d89e290a780767a92ba85977733 (diff) | |
download | sphinx-git-5e5bca98f752cb61c36afc7955183e79a6095cf2.tar.gz |
Merge branch '4.x' into 6525_linkcheck_warn_redirects
Diffstat (limited to 'sphinx/writers/manpage.py')
-rw-r--r-- | sphinx/writers/manpage.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/writers/manpage.py b/sphinx/writers/manpage.py index 3f0eea5eb..95e0f5658 100644 --- a/sphinx/writers/manpage.py +++ b/sphinx/writers/manpage.py @@ -59,13 +59,16 @@ class NestedInlineTransform: for node in self.document.traverse(matcher): # type: TextElement if any(matcher(subnode) for subnode in node): pos = node.parent.index(node) - for subnode in reversed(node[1:]): + for subnode in reversed(list(node)): node.remove(subnode) if matcher(subnode): node.parent.insert(pos + 1, subnode) else: newnode = node.__class__('', '', subnode, **node.attributes) node.parent.insert(pos + 1, newnode) + # move node if all children became siblings of the node + if not len(node): + node.parent.remove(node) class ManualPageTranslator(SphinxTranslator, BaseTranslator): |