mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3917: citation labels are tranformed to ellipsis
This commit is contained in:
parent
b6efff7990
commit
3fde14929b
1
CHANGES
1
CHANGES
@ -23,6 +23,7 @@ Bugs fixed
|
|||||||
* #4434: pure numbers as link targets produce warning
|
* #4434: pure numbers as link targets produce warning
|
||||||
* #4477: Build fails after building specific files
|
* #4477: Build fails after building specific files
|
||||||
* #4449: apidoc: include "empty" packages that contain modules
|
* #4449: apidoc: include "empty" packages that contain modules
|
||||||
|
* #3917: citation labels are tranformed to ellipsis
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -209,10 +209,15 @@ class CitationReferences(SphinxTransform):
|
|||||||
|
|
||||||
def apply(self):
|
def apply(self):
|
||||||
# type: () -> None
|
# 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):
|
for citnode in self.document.traverse(nodes.citation_reference):
|
||||||
cittext = citnode.astext()
|
cittext = citnode.astext()
|
||||||
refnode = addnodes.pending_xref(cittext, refdomain='std', reftype='citation',
|
refnode = addnodes.pending_xref(cittext, refdomain='std', reftype='citation',
|
||||||
reftarget=cittext, refwarn=True,
|
reftarget=cittext, refwarn=True,
|
||||||
|
support_smartquotes=False,
|
||||||
ids=citnode["ids"])
|
ids=citnode["ids"])
|
||||||
refnode.source = citnode.source or citnode.parent.source
|
refnode.source = citnode.source or citnode.parent.source
|
||||||
refnode.line = citnode.line or citnode.parent.line
|
refnode.line = citnode.line or citnode.parent.line
|
||||||
|
@ -380,6 +380,8 @@ def is_smartquotable(node):
|
|||||||
"""Check the node is smart-quotable or not."""
|
"""Check the node is smart-quotable or not."""
|
||||||
if isinstance(node.parent, NON_SMARTQUOTABLE_PARENT_NODES):
|
if isinstance(node.parent, NON_SMARTQUOTABLE_PARENT_NODES):
|
||||||
return False
|
return False
|
||||||
|
elif node.parent.get('support_smartquotes', None) is False:
|
||||||
|
return False
|
||||||
elif getattr(node, 'support_smartquotes', None) is False:
|
elif getattr(node, 'support_smartquotes', None) is False:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user