Page MenuHomePhabricator

VisualEditor: Pasting text doesn't work
Closed, ResolvedPublic

Description

I'm testing on mediawiki.org but am creating a bug report since these haven't been mentioned before so I don't believe they've been fixed in git.

If I try to paste some text in the editor, the paragraphs in it get stuck together, and it gets '↵' character inserted periodically, at places not corresponding to any line breaks in the text. Example:

If you want your user to be able to configure your extension, you'll ↵need to provide one or more configuration variables. It is a good idea ↵to give those variables a unique name. They should also follow MediaWiki↵ naming conventions

This happens both with pasting with Ctrl+v and with mouse. Firefox 16.0.1 on Windows XP SP 2.


Version: unspecified
Severity: normal

Details

Reference
bz41055

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:50 AM
bzimport set Reference to bz41055.

orbit wrote:

I can't reproduce this on Firefox. Can you give me more details about the type of content you're pasting and where you're pasting it? For example, "I'm copying a couple paragraphs from a normal HTML page and pasting it into a headline in the Visual Editor".

I am copying the first three paragraphs from http://www.mediawiki.org/wiki/Manual:Developing_extensions#Making_your_extension_user_configurable (starting with "If you want your user to be able to configure" and ending with "configuration variables in your installation notes.") I am pasting by clicking in VisualEditor at the end of "answers to many of your questions." paragraph and pressing Ctrl+V.

If I paste the text in a text editor, and then copy that text and paste it in the VisualEditor, the paragraphs are merged together (with an empty string) but the '↵' character does not appear.

This also happens with Firefox 11.0 on Ubuntu 10.10. It does not happen with Opera 11.50 on Ubuntu 10.10.

orbit wrote:

Thanks for the additional detail. I found the problem and have committed a fix (https://gerrit.wikimedia.org/r/#/c/28628/).

Since we don't have a HTML -> Linear Model converter, copy and paste from external sources will paste as plain text only, so the 3 paragraphs will end up collapsed. This is as-expected. There is another enhancement request (https://bugzilla.wikimedia.org/show_bug.cgi?id=33105) to better support pasting from external sources.