mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix figure directive crashes if non paragraph item is given as caption
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -27,6 +27,7 @@ Bugs fixed
|
||||
* #2394: Fix Sphinx crashes when html_last_updated_fmt is invalid
|
||||
* #2408: dummy builder not available in Makefile and make.bat
|
||||
* #2412: Fix hyperlink targets are broken in LaTeX builder
|
||||
* Fix figure directive crashes if non paragraph item is given as caption
|
||||
|
||||
|
||||
Release 1.4 (released Mar 28, 2016)
|
||||
|
||||
@@ -19,10 +19,11 @@ class Figure(images.Figure):
|
||||
|
||||
def run(self):
|
||||
name = self.options.pop('name', None)
|
||||
(figure_node,) = images.Figure.run(self)
|
||||
if isinstance(figure_node, nodes.system_message):
|
||||
return [figure_node]
|
||||
result = images.Figure.run(self)
|
||||
if len(result) == 2 or isinstance(result[0], nodes.system_message):
|
||||
return result
|
||||
|
||||
(figure_node,) = result
|
||||
if name:
|
||||
self.options['name'] = name
|
||||
self.add_name(figure_node)
|
||||
|
||||
Reference in New Issue
Block a user