summaryrefslogtreecommitdiff
path: root/sphinx/transforms/references.py
diff options
context:
space:
mode:
authorBrecht Machiels <brecht@mos6581.org>2020-09-08 17:27:57 +0200
committerBrecht Machiels <brecht@mos6581.org>2020-09-08 17:34:02 +0200
commitc9d8eac5ac08583db3fd6fd48164a4c475436ddb (patch)
tree77b2b73a421a93d922585d0013a6d45dd411a44e /sphinx/transforms/references.py
parentfabe685638c7f8fa24b3b0a44ac264cff5f1d160 (diff)
downloadsphinx-git-c9d8eac5ac08583db3fd6fd48164a4c475436ddb.tar.gz
Don't remove substitution_reference nodes (fix #7953)
SubstitutionDefinitionsRemover is now a SphinxPostTransform, only applied in the Sphinx builder, as was originally the case (see #4827).
Diffstat (limited to 'sphinx/transforms/references.py')
-rw-r--r--sphinx/transforms/references.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/sphinx/transforms/references.py b/sphinx/transforms/references.py
index e74d9657d..b6129b0bc 100644
--- a/sphinx/transforms/references.py
+++ b/sphinx/transforms/references.py
@@ -10,8 +10,7 @@
from typing import Any, Dict
-from docutils import nodes
-from docutils.transforms.references import DanglingReferences, Substitutions
+from docutils.transforms.references import DanglingReferences
from sphinx.transforms import SphinxTransform
@@ -20,17 +19,6 @@ if False:
from sphinx.application import Sphinx
-class SubstitutionDefinitionsRemover(SphinxTransform):
- """Remove ``substitution_definition node from doctrees."""
-
- # should be invoked after Substitutions process
- default_priority = Substitutions.default_priority + 1
-
- def apply(self, **kwargs: Any) -> None:
- for node in self.document.traverse(nodes.substitution_definition):
- node.parent.remove(node)
-
-
class SphinxDanglingReferences(DanglingReferences):
"""DanglingReferences transform which does not output info messages."""
@@ -56,7 +44,6 @@ class SphinxDomains(SphinxTransform):
def setup(app: "Sphinx") -> Dict[str, Any]:
- app.add_transform(SubstitutionDefinitionsRemover)
app.add_transform(SphinxDanglingReferences)
app.add_transform(SphinxDomains)