Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
jCaption wraps images in a 'div' tag. If this image is found inside a paragraph ('p' tags) it results in invalid HTML. See http://stackoverflow.com/questions/4291467/nesting-block-level-elements-....
Would it be problematic to use a 'span' instead? Maybe with style:"display: inline-block";
if the block behaviour is needed. Or can we avoid inline styling?
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2014-08-26_13-45-58.png | 191.82 KB | windtrader |
#2 | span_instead_of_div-2154497-1.patch | 6.09 KB | lolandese |
Comments
Comment #1
lolandese CreditAttribution: lolandese commentedPatch attached. Quick testing revealed that copying of the style from 'img' to 'span' is defunct after this patch.
Comment #2
lolandese CreditAttribution: lolandese commentedForgot to attach the patch.
Comment #4
acke CreditAttribution: acke commentedAha, good catch. Fixed and pushed to head, going into the 1.4 release.
Comment #6
windtrader CreditAttribution: windtrader commentedThe recent change to span from div lets the caption run beyond the width of the image. I tested using 1.3 and the div preserves the width.
Another issue with the caption. When text wraps the image, content following just below the image overlays the caption. This is observed in 1.3 so not a new problem.
Image posted.