1. Gabi Davar
  2. sphinx


Marc Schlaich  committed b9be477

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

  • Participants
  • Parent commits 70d85c8
  • Branches stable

Comments (0)

Files changed (1)

File sphinx/builders/html.py

View file
  • Ignore whitespace
         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