#9066 closed defect (bug) (fixed)
editor_plugin.js adds "hard-coded" inline-style for width+10px which makes it hard for theme development
Reported by: | sporketeer | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.9 | Priority: | high |
Severity: | normal | Version: | |
Component: | JavaScript | Keywords: | |
Focuses: | Cc: |
Description
In /wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js in line 122 additional 10 pixels get added to the value entered by a user. This might seem okay if you are using the default theme and some other themes, but it is bad markup making it hard for theme developers to change things around.
Example for a problem:
An image gets uploaded and has a width of 300 pixels. When a caption gets used the following mark-up is being created:
<p><div id="attachment_118" class="wp-caption alignleft" style="width: 310px"><img src="http://www.domain.com/wp-content/uploads/foto-2-300x225.jpg" alt="…
the div has a class and an id so there is no need for inline styles, especially not if it inserts some weird width attribute which someone thought to be appropriate. CSS is great for styling but please leave the styling to the theme's CSS!
So the additional 10 pixels should be taken out, please.
A picture of x pixels in width should be within a div of no size whatsoever, at least not inline styled width.
Thank you!
This only affects displaying of captions inside the visual editor. For the site the tags are created by the [caption] shortcode. If you want to change the defaults you can add a different function that parses it and use the "img_caption_shortcode" filter to replace the output.