Fix #5391: A cross reference in heading is rendered as literal

This commit is contained in:
Takeshi KOMIYA 2019-03-02 21:07:54 +09:00
parent ac9e9c0745
commit 615c0f8091
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 * #5508: ``linenothreshold`` option for ``highlight`` directive was ignored
* texinfo: ``make install-info`` causes syntax error * texinfo: ``make install-info`` causes syntax error
* texinfo: ``make install-info`` fails on macOS * texinfo: ``make install-info`` fails on macOS
* #5391: A cross reference in heading is rendered as literal
Testing Testing
-------- --------

View File

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