Skip to content

Commit

Permalink
refs sphinx-doc#1742: use implicit target name for figure directive's…
Browse files Browse the repository at this point in the history
… permalink.
  • Loading branch information
shimizukawa committed Mar 8, 2015
1 parent 09d3d6b commit 28e1b19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sphinx/writers/html.py
Expand Up @@ -333,7 +333,8 @@ def depart_caption(self, node):
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, _('Permalink to this image'))
self.add_permalink_ref(
node.parent.traverse(nodes.image)[0], _('Permalink to this image'))
elif node.parent.get('toctree'):
self.add_permalink_ref(node.parent.parent, _('Permalink to this toctree'))

Expand Down

0 comments on commit 28e1b19

Please sign in to comment.