-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't remove substitution_reference nodes (fix #7953) #8183
Don't remove substitution_reference nodes (fix #7953) #8183
Conversation
SubstitutionDefinitionsRemover is now a SphinxPostTransform, only applied in the Sphinx builder, as was originally the case (see sphinx-doc#4827).
636682f
to
c9d8eac
Compare
Some of the tests that have rst_epilog or rst_prolog set need to be adjusted to not fail when encountering substitution definitions which have reappeared since fixing sphinx-doc#7953.
@@ -21,7 +21,8 @@ def test_code_directive(app): | |||
' print("hello world")\n') | |||
|
|||
doctree = restructuredtext.parse(app, text) | |||
assert_node(doctree, [nodes.document, nodes.literal_block, 'print("hello world")']) | |||
assert_node(doctree, ([nodes.literal_block, 'print("hello world")'], | |||
nodes.substitution_definition)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, I found the reason why the substituion_definition node appears suddenly here. tests/roots/test-root/conf.py
contains a substitution definition in its rst_epilog
. We need to remove it to be these testcases healthy. I'll work on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just posted #8295 to fix it. So please update this PR. Then I'll review this again.
I merged this partially (without unnecessary changes of testings) at #8354. |
Thanks, @tk0miya. I didn't find the time yet to get back to this, so you beat me to it. Cheers! |
SubstitutionDefinitionsRemover is now a SphinxPostTransform, only
applied in the Sphinx builder, as was originally the case (see #4827).