mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #1788: graphviz extension raises exception when caption option is present
This commit is contained in:
parent
1c32a0fc3e
commit
11f9b5ff20
2
CHANGES
2
CHANGES
@ -4,6 +4,8 @@ Release 1.3.2 (in development)
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #1788: graphviz extension raises exception when caption option is present.
|
||||
|
||||
|
||||
Release 1.3.1 (released Mar 17, 2015)
|
||||
=====================================
|
||||
|
@ -349,8 +349,9 @@ class HTMLTranslator(BaseTranslator):
|
||||
if isinstance(node.parent, nodes.container) and node.parent.get('literal_block'):
|
||||
self.add_permalink_ref(node.parent, _('Permalink to this code'))
|
||||
elif isinstance(node.parent, nodes.figure):
|
||||
self.add_permalink_ref(
|
||||
node.parent.traverse(nodes.image)[0], _('Permalink to this image'))
|
||||
image_nodes = node.parent.traverse(nodes.image)
|
||||
target_node = image_nodes and image_nodes[0] or node.parent
|
||||
self.add_permalink_ref(target_node, _('Permalink to this image'))
|
||||
elif node.parent.get('toctree'):
|
||||
self.add_permalink_ref(node.parent.parent, _('Permalink to this toctree'))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user