WordPress.org

Make WordPress Core

#22766 closed defect (bug) (fixed)

TinyMCE Unable to Delete Weird HTML Elements

Reported by: merty Owned by: azaozz
Milestone: 3.5.1 Priority: normal
Severity: normal Version: 3.5
Component: TinyMCE Keywords:
Focuses: Cc:

Description

I somehow managed to get a post like this (Copying from Text tab in the editor):

<img class="alignnone size-medium wp-image-undefined" alt="" src="undefined" height="undefined" width="undefined" /> Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

When I place the caret right before the Welcome word and try deleting the image using backspace, it deletes the space in between the image and the word Welcome, and moves the text to the next line.

3.4.2 seems to be able to delete the image just fine.

Change History (15)

comment:2 merty17 months ago

  • Component changed from General to TinyMCE

comment:3 azaozz17 months ago

  • Priority changed from normal to low
  • Severity changed from normal to minor

Works properly in Firefox and IE, seems only WebKit browsers hesitate when deleting an image that way. Also selecting the actual image and deleting it either with backspace or delete keys works as expected.

comment:4 MikeHansenMe17 months ago

Worked as expected w/ chrome, ff on Ubuntu

comment:5 merty17 months ago

Also works as expected with Safari 6 (Mac). I guess this is a Chrome 23 (Mac) issue, rather than a TinyMCE issue.

comment:6 merty17 months ago

The problem happens on Chrome 25 (Mac) as well.

This is weird.

Last edited 17 months ago by merty (previous) (diff)

comment:7 nacin17 months ago

  • Priority changed from low to normal
  • Severity changed from minor to normal

If this is a regression from 3.4.2, this is not minor severity or low priority.

How did you end up with the "undefined" bits?

comment:8 follow-up: merty17 months ago

Not sure, I was messing with the media modal (adding images, deleting them permanently etc.) and somehow ended up with that. That was two weeks ago, so I can't remember. All I know is that I did not modify it manually.

Two weeks -> More than a week.

Last edited 17 months ago by merty (previous) (diff)

comment:9 in reply to: ↑ 8 nacin17 months ago

Replying to merty:

Not sure, I was messing with the media modal (adding images, deleting them permanently etc.) and somehow ended up with that. That was two weeks ago, so I can't remember. All I know is that I did not modify it manually.

Two weeks -> More than a week.

Okay, that was probably when MCE views were still in core.

Nonetheless, it should still be deletable.

comment:10 nacin17 months ago

Background, #22124.

comment:11 azaozz17 months ago

This seems like a regression upstreams. In WebKit when loading the HTML into TinyMCE, if a text node after an image node starts with a space, the space is replaced with &nbsp;. This works in TinyMCE 3.4.9 (WordPress 3.4) but doesn't seem to work consistently in TinyMCE 3.5.7 and 3.5.8. Made a test on the TinyMCE JS Fiddle page: http://fiddle.tinymce.com/z0caab/5

Last edited 17 months ago by azaozz (previous) (diff)

comment:12 nacin17 months ago

  • Milestone changed from Awaiting Review to 3.5.1

So:

  • This is only in Chrome/Webkit.
  • It is inconsistent.
  • It is only for hitting backspace, if you haven't yet clicked on the image.
  • If the backspace key doesn't work, chances are the next thing you will do is click on the image anyway.
  • Our delete button from the wpeditimage plugin still works.
  • It's annoying, but not a blocker.

With that, I'm moving this to 3.5.1.

Relevant IRC discussion: https://irclogs.wordpress.org/chanlog.php?channel=wordpress-dev&day=2012-12-06&sort=asc#m509233.

comment:13 azaozz16 months ago

  • Resolution set to fixed
  • Status changed from new to closed

Related to #23010, Should be fixed in [23192] for trunk.

comment:14 azaozz16 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Leaving this open until the patch is applied to the 3.5.1 milestone.

comment:15 azaozz16 months ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from reopened to closed

In 23217:

TinyMCE: update to latest source including the WebKit backspace fix, fixes #23010, fixes #22766 for 3.5

Note: See TracTickets for help on using tickets.