mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6137 from tk0miya/6136_math_name_causes_crash
Fix #6136: ``:name:`` option for ``math`` directive causes a crash
This commit is contained in:
commit
99932ac2bc
1
CHANGES
1
CHANGES
@ -25,6 +25,7 @@ Bugs fixed
|
|||||||
* #6047: autodoc: ``autofunction`` emits a warning for method objects
|
* #6047: autodoc: ``autofunction`` emits a warning for method objects
|
||||||
* #6028: graphviz: Ensure the graphviz filenames are reproducible
|
* #6028: graphviz: Ensure the graphviz filenames are reproducible
|
||||||
* #6068: doctest: ``skipif`` option may remove the code block from documentation
|
* #6068: doctest: ``skipif`` option may remove the code block from documentation
|
||||||
|
* #6136: ``:name:`` option for ``math`` directive causes a crash
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -123,13 +123,16 @@ class MathDirective(SphinxDirective):
|
|||||||
latex = '\n'.join(self.content)
|
latex = '\n'.join(self.content)
|
||||||
if self.arguments and self.arguments[0]:
|
if self.arguments and self.arguments[0]:
|
||||||
latex = self.arguments[0] + '\n\n' + latex
|
latex = self.arguments[0] + '\n\n' + latex
|
||||||
|
label = self.options.get('label', self.options.get('name'))
|
||||||
node = nodes.math_block(latex, latex,
|
node = nodes.math_block(latex, latex,
|
||||||
docname=self.state.document.settings.env.docname,
|
docname=self.state.document.settings.env.docname,
|
||||||
number=self.options.get('name'),
|
number=None,
|
||||||
label=self.options.get('label'),
|
label=label,
|
||||||
nowrap='nowrap' in self.options)
|
nowrap='nowrap' in self.options)
|
||||||
ret = [node]
|
self.add_name(node)
|
||||||
set_source_info(self, node)
|
set_source_info(self, node)
|
||||||
|
|
||||||
|
ret = [node]
|
||||||
self.add_target(ret)
|
self.add_target(ret)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user