diff --git a/CHANGES b/CHANGES index b265ba2c1..3d123f00d 100644 --- a/CHANGES +++ b/CHANGES @@ -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 -------- diff --git a/sphinx/transforms/__init__.py b/sphinx/transforms/__init__.py index acfff6a4d..ed3c19ba5 100644 --- a/sphinx/transforms/__init__.py +++ b/sphinx/transforms/__init__.py @@ -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 diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py index 97e5b7f30..569a4c7b3 100644 --- a/sphinx/util/nodes.py +++ b/sphinx/util/nodes.py @@ -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: