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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lolandese’s picture

Status: Active » Needs work

Patch attached. Quick testing revealed that copying of the style from 'img' to 'span' is defunct after this patch.

lolandese’s picture

Forgot to attach the patch.

  • Commit 4cd3ffb on 7.x-1.x authored by lolandese, committed by acke:
    Issue #2154497 by lolandese: A div inside a p element results in invalid...
acke’s picture

Category: Support request » Bug report
Status: Needs work » Fixed

Aha, good catch. Fixed and pushed to head, going into the 1.4 release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

windtrader’s picture

FileSize
191.82 KB

The 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.