Page MenuHomePhabricator

Visual editor strips links from pasted rich text
Closed, DeclinedPublic

Description

Copy some rich text from (the read version of) Wikipedia or another website. Paste it into the visual editor. Formatting like bold and italics will copy properly, but links won't.

For example, take the first sentence from enwiki:The New York Times: "The New York Times is an American daily newspaper...". If you paste it into a content editable sandbox, you'll get the correct HTML:

<i style="color: rgb(37, 37, 37); font-family: sans-serif; font-size: 14px; line-height: 22.4px; background-color: rgb(255, 255, 255);"><b>The New York Times</b></i><span style="color: rgb(37, 37, 37); font-family: sans-serif; font-size: 14px; line-height: 22.4px; background-color: rgb(255, 255, 255);">&nbsp;(</span><i style="color: rgb(37, 37, 37); font-family: sans-serif; font-size: 14px; line-height: 22.4px; background-color: rgb(255, 255, 255);"><b>NYT</b></i><span style="color: rgb(37, 37, 37); font-family: sans-serif; font-size: 14px; line-height: 22.4px; background-color: rgb(255, 255, 255);">) is an American daily&nbsp;</span><a href="https://en.wikipedia.org/wiki/Newspaper" title="Newspaper" style="text-decoration: none; color: rgb(11, 0, 128); font-family: sans-serif; font-size: 14px; line-height: 22.4px; background: none rgb(255, 255, 255);">newspaper</a><span style="color: rgb(37, 37, 37); font-family: sans-serif; font-size: 14px; line-height: 22.4px; background-color: rgb(255, 255, 255);">...

But if you paste it into the visual editor, the link on "newspaper" won't be copied.

Seen on enwiki and the beta cluster using Chrome and Firefox.

Event Timeline

nshahquinn-wmf raised the priority of this task from to High.
nshahquinn-wmf updated the task description. (Show Details)
nshahquinn-wmf subscribed.
Jdforrester-WMF claimed this task.

This is intentional, as inline external links are poor for readers and so deliberately stripped.

Clearly I'm losing my tenuous grip on reality, because I felt sure this used to be possible. :(

This is intentional, as inline external links are poor for readers and so deliberately stripped.

Well, there is another task to automatically make them not external - T67540
Also often links in pages are analogous to wikipedia references and could be (semi)automatically converted to them.
For now Visual editor just looks inferior to all the other rich online editors and requires a lot of unneeded handwork