Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#22766 closed defect (bug) (fixed)

TinyMCE Unable to Delete Weird HTML Elements

Reported by: merty's profile merty Owned by: azaozz's profile 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)

#2 @merty
12 years ago

  • Component changed from General to TinyMCE

#3 @azaozz
12 years 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.

#4 @MikeHansenMe
12 years ago

Worked as expected w/ chrome, ff on Ubuntu

#5 @merty
12 years ago

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

#6 @merty
12 years ago

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

This is weird.

Last edited 12 years ago by merty (previous) (diff)

#7 @nacin
12 years 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?

#8 follow-up: @merty
12 years 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 12 years ago by merty (previous) (diff)

#9 in reply to: ↑ 8 @nacin
12 years 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.

#10 @nacin
12 years ago

Background, #22124.

#11 @azaozz
12 years 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 12 years ago by azaozz (previous) (diff)

#12 @nacin
12 years 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.

#13 @azaozz
12 years ago

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

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

#14 @azaozz
12 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

#15 @azaozz
12 years 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.