Page MenuHomePhabricator

Strip uneditable formatting when pasting in VisualEditor
Closed, ResolvedPublic1 Story Points

Description

I'm not sure what the desired behavior is in this situation, so I'm opening this to know either way.

When the user copies formatted text and then pastes it into VisualEditor, VE does its best to preserve the formatting and converts it to the corresponding wikitext.

However, some types of formatting (e.g. text color) are discouraged on most Wikimedia sites. In this example edit, the user inserted (and saved with VE) text that was underlined and colored blue. Underlining is usually discouraged in articles, but the user could have removed it using the VE toolbar. However, the toolbar doesn't allow them to change the text color, so they wouldn't have been able to fix it even if they had noticed it.

One possible solution could be to keep formatting that is supported by the toolbar, and to strip what can't be edited.

Event Timeline

gpaumier created this task.Mar 31 2015, 5:36 PM
gpaumier raised the priority of this task from to Needs Triage.
gpaumier updated the task description. (Show Details)
gpaumier added a subscriber: gpaumier.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 31 2015, 5:36 PM

The exact bug in the diff you linked (pasting links from VE to VE in IE causes them to be wrapped in <u><font color="#0066cc">) was fixed in https://gerrit.wikimedia.org/r/#/c/200486/

The general issue is something I can't reproduce either: both underline and font are blacklisted for external (non-VE to VE) pasting. They're kept when pasting from VE to VE, but that's fine.

Jdforrester-WMF closed this task as Resolved.Mar 31 2015, 7:13 PM
Jdforrester-WMF assigned this task to Catrope.
Jdforrester-WMF triaged this task as High priority.
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from Nominated to Done on the VisualEditor 2014/15 Q3 blockers board.
Jdforrester-WMF moved this task from To Triage to Q4 on the VisualEditor board.Apr 1 2015, 4:11 PM