Opened 6 months ago

Closed 5 months ago

#22766 closed defect (bug) (fixed)

TinyMCE Unable to Delete Weird HTML Elements

Reported by: merty Owned by: azaozz
Priority: normal Milestone: 3.5.1
Component: TinyMCE Version: 3.5
Severity: normal Keywords:
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)

  • Component changed from General to TinyMCE
  • 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.

Worked as expected w/ chrome, ff on Ubuntu

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

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

This is weird.

Last edited 6 months ago by merty (previous) (diff)
  • 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: ↓ 9   merty6 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 6 months ago by merty (previous) (diff)

comment:9 in reply to: ↑ 8   nacin6 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.

Background, #22124.

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/3

Version 0, edited 6 months ago by azaozz (next)
  • 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.

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

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

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

  • 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.