|Reported by:||Looimaster||Owned by:||azaozz|
In /wp-includes/media.php in img_caption_shortcode() there is a note saying By default, the caption is 10 pixels greater than the width of the image, to prevent post content from running up against a floated image.
but this makes the caption text misaligned (too long) 10px in all the possible cases:
- image floating left
- image floating right
- image centered
- image with alignnone
Caption text is longer than the image. Not exactly below the image.
Furthermore, if an image without caption (for example 150px wide) is placed below/above the image with caption (150px converted to 160px) and both are left aligned then it forms a misaligned grid (all images with captions push the text 10px to the right).
When I remove this 10px increment, everything looks exactly like expected. Post content doesn't run onto the image or caption in any case and I tested them all. I'm wondering if this 10px increment should be there? What does it do? Maybe that's a bug?
Change History (59)
- Cc bcworkz added
- Keywords has-patch 2nd-opinion added
- Type changed from defect (bug) to enhancement
- Keywords has-patch 2nd-opinion removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
- Summary changed from [caption] is 10px too wide to HTML5 captions
- Type changed from enhancement to task (blessed)