Opened 14 years ago
Closed 14 years ago
#15095 closed defect (bug) (fixed)
Visual Editor inserts empty paragraphs before/after captioned images
Reported by: | markel | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | major | Version: | 3.1 |
Component: | Editor | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
Tested in Safari 5 and Firefox 3 on most recent nightly (as of 10/10/10) 3.1-alpha.
When adding an image with a caption using the Visual Editor, paragraphs containing non-breaking spaces are added before and after the image. This isn't readily apparent in the Editor itself, but is pretty clear when viewing the post.
To reproduce:
- Create a post that includes any image with a caption in it using the Visual Editor. Publish the post or save the draft.
- Check the resulting post. You will see the added paragraphs.
Sample code after publish:
Testing an image. [caption id="attachment_48" align="alignnone" width="640" caption="I can rotate things."]<a href="http://26mag.com/wp-content/uploads/2010/10/bungienetshot.png"><img class="size-large wp-image-48" title="bungienetshot" src="http://26mag.com/wp-content/uploads/2010/10/bungienetshot-1024x575.png" alt="" width="640" height="359" /></a>[/caption]
Change History (12)
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
14 years ago
- Keywords reporter-feedback added
Replying to markel:
Cannot reproduce either behavior. Are you using any TinyMCE plugins like TinyMCE Advanced with the "Preserve new lines" option turned on?
#4
in reply to:
↑ 3
@
14 years ago
Replying to azaozz:
Cannot reproduce either behavior. Are you using any TinyMCE plugins like TinyMCE Advanced with the "Preserve new lines" option turned on?
I'm not using any TinyMCE-altering plugins; was just able to reproduce it with a captioned image with no plugins installed of any kind.
#5
@
14 years ago
Reproduced with r15782.
Steps:
- Open any post with a captioned image.
- Click in the following order: Update button, HTML tab, Visual tab. Then repeat.
---> Each time you repeat, a non-breaking space is added above and below the captioned image.
Screencast example: http://screencast.com/t/6qVpiPPMQd
#6
@
14 years ago
You can also cause this to happen by using Paste from Word. Click the button, paste some text, insert it, then publish. As long as you don't swap over to the HTML editor, non-breaking spaces will be added to the pasted text.
#7
@
14 years ago
These problems seem to come from a change in behaviour in TinyMCE. When performing a cleanup things like <p><div>....</div></p>
are converted to <p></p><div>...
, i.e. the invalid <p>
tag is closed properly instead of removed.
I'm still working on a proper fix for this.
#9
@
14 years ago
The above patch fixes this when inserting the caption shortcode but is an "after the fact" fix. A proper solution would be part of TinyMCE in collaboration with their dev team.
This also affects some styling created using the visual editor. Steps to reproduce:
This doesn't occur in 2.9.2 and seems undesirable, so I'm nudging the severity.