Merge pull request #6126 from tk0miya/5391_xref_in_heading

Fix #5391: A cross reference in heading is rendered as literal
This commit is contained in:
Takeshi KOMIYA
2019-03-06 01:34:24 +09:00
committed by GitHub
2 changed files with 2 additions and 5 deletions

View File

@@ -22,6 +22,7 @@ Bugs fixed
* #5508: ``linenothreshold`` option for ``highlight`` directive was ignored
* texinfo: ``make install-info`` causes syntax error
* texinfo: ``make install-info`` fails on macOS
* #5391: A cross reference in heading is rendered as literal
Testing
--------

View File

@@ -340,11 +340,7 @@ class SphinxContentsFilter(ContentsFilter):
Used with BuildEnvironment.add_toc_from() to discard cross-file links
within table-of-contents link nodes.
"""
def visit_pending_xref(self, node):
# type: (addnodes.pending_xref) -> None
text = node.astext()
self.parent.append(nodes.literal(text, text))
raise nodes.SkipNode
visit_pending_xref = ContentsFilter.ignore_node_but_process_children
def visit_image(self, node):
# type: (nodes.image) -> None