Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39570 closed defect (bug) (fixed)

Extra markup added to links with IE11

Reported by: ChrisWiegman Owned by: azaozz
Priority: normal Milestone: 4.8
Component: TinyMCE Version: 4.7
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

When pasting a link to TinyMCE using Win 7, IE 11 extra markup is added to links resulting in problems with display. For example, pasting:

<a href="https://codex.wordpress.org/Validating_Sanitizing_and_Escaping_User_Data" target="_blank">number of functions available to handle nearly any situation</a>

will result in:

<a href="https://codex.wordpress.org/Validating_Sanitizing_and_Escaping_User_Data" target="_blank"><u><span style="color: #0066cc;">number of functions available to handle nearly any situation</span></u></a>

This is reproducible by pasting any text with a link into TinyMCE using Windows 7 and IE11.

Attachments (1)

39570.patch​ (771 bytes ) - added by azaozz 10 years ago.

Download all attachments as: .zip

Change History (7)

#1 @azaozz
10 years ago

  • Keywords needs-patch added
  • Milestone Awaiting Review → 4.8

Confirmed. Also happens in Edge on Win10. Similar to the cruft that Chrome inserts but only when pasting links (fortunately).

The good news is that we already have filtering on paste for Chrome/WebKit what we can also turn on for IE/Edge.

The bad news is that Edge can also insert other tags without inline styles, in particular seeing <u> (see the example in the ticket) and <font>!! The only thing I can think of is to strip these tags when wrapped in links.

This will remove the <u> even if the original content that was copied had that tag combination. However it seems better to "clean up" such cases.

Last edited 10 years ago by azaozz (previous) (diff)

#2 @azaozz
10 years ago

In 39570.patch: remove <font> and <u> tags from inside links when pasting in IE and Edge.

The actual tag that is inserted by these browsers is <font color=...> and TinyMCE converts it to a span to make it valid.

Version 0, edited 10 years ago by azaozz (next)

#3 @azaozz
10 years ago

  • Keywords has-patch added; needs-patch removed

#4 follow-up: @iseulde
10 years ago

Shouldn't we push for a fix in MCE?

#5 in reply to: ↑ 4 @azaozz
10 years ago

Replying to iseulde:
Sure. Thinking best would be to fix it here for now, then remove when it is fixed upstream in the paste plugin.

#6 @azaozz
10 years ago

  • Owner set to azaozz
  • Resolution → fixed
  • Status new → closed

In 39916:

TinyMCE: strip browser inserted <u> and <font>` tags from inside links when copying and pasting in IE and Edge.

Fixes #39570.

Note: See TracTickets for help on using tickets.