Page MenuHomePhabricator

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


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 raised the priority of this task from to Needs Triage.
gpaumier updated the task description. (Show Details)
gpaumier added a subscriber: gpaumier.

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

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 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.