Make WordPress Core

Opened 14 years ago

Closed 14 years 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: Focuses:

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
14 years ago

  • Component GeneralTinyMCE

#3 @azaozz
14 years ago

  • Priority normallow
  • Severity normalminor

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
14 years ago

Worked as expected w/ chrome, ff on Ubuntu

#5 @merty
14 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
14 years ago

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

This is weird.

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

#7 @nacin
14 years ago

  • Priority lownormal
  • Severity minornormal

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
14 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 14 years ago by merty (previous) (diff)

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

Background, #22124.

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

#12 @nacin
14 years ago

  • Milestone Awaiting Review3.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
14 years ago

  • Resolutionfixed
  • Status newclosed

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

#14 @azaozz
14 years ago

  • Resolution fixed
  • Status closedreopened

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

#15 @azaozz
14 years ago

  • Owner set to azaozz
  • Resolutionfixed
  • Status reopenedclosed

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.