Make WordPress Core

Opened 13 years ago

Closed 9 years ago

Last modified 9 years ago

#14341 closed defect (bug) (worksforme)

Adjacent image disappears when a caption is added

Reported by: designsimply's profile designsimply Owned by:
Milestone: Priority: normal
Severity: major Version:
Component: TinyMCE Keywords:
Focuses: Cc:


If you place two images side by side inside a strong tag and then try to add a caption to one of the images, the other image disappears.

Tested in r15436.

To reproduce:
1) Open a new or existing post for editing
2) Place the sample code from below into the html editor
3) Switch to the visual editor and try to add a caption
---> You'll see the other image disappear

Here is a screencast example:

Here is some sample code:

<strong><a href=""><img class="alignleft size-full" title="grey logo" src="" alt="" width="100" height="100" /></a><a href=""><img class="alignleft size-full" title="blue logo" src="" alt="" width="100" height="100" /></a></strong>

Change History (5)

#1 @nacin
12 years ago

Is this a regression? I imagine not.

Can it be tested again on the new version of TinyMCE?

#2 @mdawaffe
12 years ago

  • Component changed from General to TinyMCE
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Severity changed from normal to major

Still broken in r17316.

#3 @azaozz
12 years ago

<strong> is an inline tag, inserting a block tag like <div> or <dd> in there makes the HTML invalid. I think the browsers have difficulties displaying such HTML in contentEditable mode. In order to "fix" the invalidly nested tags it seems TinyMCE removes the <strong> node leaving only the new block node there.

Not sure what we can do about these border cases where user edited code is later edited in the visual editor leading to invalid HTML.

#4 @thee17
9 years ago

  • Keywords captions needs-patch removed
  • Resolution set to worksforme
  • Status changed from new to closed

Just checked with the new TinyMCE 4.0 modifications and this behaviour no longer happens. It strips the strong tag but does not eliminate the second image.

#5 @ocean90
9 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.