Create link to full size image if it is scaled with width or height.

This commit is contained in:
ms4py
2012-03-16 10:45:51 +01:00
parent 249ee22c4d
commit 88e852aa7e

View File

@@ -610,7 +610,8 @@ class StandaloneHTMLBuilder(Builder):
"""
Builder.post_process_images(self, doctree)
for node in doctree.traverse(nodes.image):
if not node.has_key('scale') or \
scale_keys = ('scale', 'width', 'height')
if not any((key in node) for key in scale_keys) or \
isinstance(node.parent, nodes.reference):
# docutils does unfortunately not preserve the
# ``target`` attribute on images, so we need to check