Fix #3917: citation labels are tranformed to ellipsis

This commit is contained in:
Takeshi KOMIYA 2018-01-27 23:23:59 +09:00
parent b6efff7990
commit 3fde14929b
3 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,7 @@ Bugs fixed
* #4434: pure numbers as link targets produce warning
* #4477: Build fails after building specific files
* #4449: apidoc: include "empty" packages that contain modules
* #3917: citation labels are tranformed to ellipsis
Testing
--------

View File

@ -209,10 +209,15 @@ class CitationReferences(SphinxTransform):
def apply(self):
# type: () -> None
# mark citation labels as not smartquoted
for citnode in self.document.traverse(nodes.citation):
citnode[0]['support_smartquotes'] = False
for citnode in self.document.traverse(nodes.citation_reference):
cittext = citnode.astext()
refnode = addnodes.pending_xref(cittext, refdomain='std', reftype='citation',
reftarget=cittext, refwarn=True,
support_smartquotes=False,
ids=citnode["ids"])
refnode.source = citnode.source or citnode.parent.source
refnode.line = citnode.line or citnode.parent.line

View File

@ -380,6 +380,8 @@ def is_smartquotable(node):
"""Check the node is smart-quotable or not."""
if isinstance(node.parent, NON_SMARTQUOTABLE_PARENT_NODES):
return False
elif node.parent.get('support_smartquotes', None) is False:
return False
elif getattr(node, 'support_smartquotes', None) is False:
return False
else: