refs #1742: use implicit target name for figure directive's permalink.

This commit is contained in:
shimizukawa 2015-03-08 20:22:20 +09:00
parent 09d3d6b36d
commit 28e1b1996d

View File

@ -333,7 +333,8 @@ 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, _('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'))