Merge branch '1.8' into 2.0

This commit is contained in:
Takeshi KOMIYA 2019-03-07 01:22:10 +09:00
commit fbb7e9d267
2 changed files with 7 additions and 3 deletions

View File

@ -297,6 +297,7 @@ Bugs fixed
* #6047: autodoc: ``autofunction`` emits a warning for method objects
* #6028: graphviz: Ensure the graphviz filenames are reproducible
* #6068: doctest: ``skipif`` option may remove the code block from documentation
* #6136: ``:name:`` option for ``math`` directive causes a crash
Testing
--------

View File

@ -126,13 +126,16 @@ class MathDirective(SphinxDirective):
latex = '\n'.join(self.content)
if self.arguments and self.arguments[0]:
latex = self.arguments[0] + '\n\n' + latex
label = self.options.get('label', self.options.get('name'))
node = nodes.math_block(latex, latex,
docname=self.env.docname,
number=self.options.get('name'),
label=self.options.get('label'),
number=None,
label=label,
nowrap='nowrap' in self.options)
ret = [node] # type: List[nodes.Node]
self.add_name(node)
set_source_info(self, node)
ret = [node] # type: List[nodes.Node]
self.add_target(ret)
return ret