regebro / hovercraft

Make dynamic impressive presentations from text files!
https://hovercraft.readthedocs.org
MIT License
1.48k stars 209 forks source link

Problem with classes and target option of images #223

Closed aliamondano closed 2 years ago

aliamondano commented 2 years ago

I am using Hovercraft 2.8, but I have found something strange:

I am using classes for aligning pictures at right. But, when I put 'target' option to an image in rst file, the class is not applied to anchor tag nor to image tag in output html. Please view the attached files. If you drop out the target option of the first image in rst file, that image will be aligned to the right because then (without target option) specified class really is applied. If you put the target option to the second image or third image, this will be dropped from the right to normal position (static, centered).

That is a bug, I think. When there is an image with a target option inside a class directive.

bug.zip Thank you very much.

regebro commented 2 years ago

This is either a bug, or possibly a feature of docutils. However, a better way to set a class on an image is to use the :class: image option:

.. image:: https://upload.wikimedia.org/wikipedia/commons/0/0f/Cosmic_web.jpg
    :width: 30%
    :target: http://www.google.com 
    :class: img-arriba