WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 6 months ago

Last modified 5 months ago

#14341 closed defect (bug) (worksforme)

Adjacent image disappears when a caption is added

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

Description

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: http://screencast.com/t/OTNmNjQzN

Here is some sample code:

<strong><a href="http://s.wordpress.org/about/images/logo-grey/grey-m.png"><img class="alignleft size-full" title="grey logo" src="http://s.wordpress.org/about/images/logo-grey/grey-m.png" alt="" width="100" height="100" /></a><a href="http://s.wordpress.org/about/images/logo-blue/blue-m.png"><img class="alignleft size-full" title="blue logo" src="http://s.wordpress.org/about/images/logo-blue/blue-m.png" alt="" width="100" height="100" /></a></strong>

Change History (5)

comment:1 nacin4 years ago

Is this a regression? I imagine not.

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

comment:2 mdawaffe3 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.

comment:3 azaozz3 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.

comment:4 thee176 months 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.

comment:5 ocean905 months ago

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