mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #5025 from tk0miya/5017_replace_displaymath_by_math_block
Fix #5017: old displaymath node makes writers crashed
This commit is contained in:
commit
c48038782d
@ -71,8 +71,12 @@ class MathNodeMigrator(SphinxTransform):
|
||||
warnings.warn("math node for Sphinx was replaced by docutils'. "
|
||||
"Please use ``docutils.nodes.math_block`` instead.",
|
||||
RemovedInSphinx30Warning)
|
||||
latex = node['latex']
|
||||
node += nodes.Text(latex, latex)
|
||||
if isinstance(node, displaymath):
|
||||
newnode = nodes.math_block('', node['latex'], **node.attributes)
|
||||
node.replace_self(newnode)
|
||||
else:
|
||||
latex = node['latex']
|
||||
node += nodes.Text(latex, latex)
|
||||
|
||||
|
||||
def setup(app):
|
||||
|
Loading…
Reference in New Issue
Block a user