Page MenuHomePhabricator

Pasting multiple spaces (U+0020) instead pastes NBSPs, which breaks e.g. template formatting
Closed, ResolvedPublic1 Estimated Story Points

Description

I don't know what's actually wrong in those spaces, but something indeed, as templates goes broken.
The NWE is doing it automatically, when it shouldn't.

Diffs:
https://fi.wikipedia.org/w/index.php?title=Jarkko_Nieminen&diff=16151267&oldid=16045053
https://meta.wikimedia.org/w/index.php?title=Steward_requests/Permissions&diff=16197729&oldid=16197726

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

In the diffs normal spaces have been replaced by non-breakable spaces.

As the first edit also removed some empty lines this reminds me a bit of T152671. I wasn't able to reproduce the issue in Firefox in similar circumstances. Which browser are you using?

I have the newest Firefox.

In the first edit, I actually used the tool http://dispenser.homenet.org/~dispenser/cgi-bin/webchecklinks.py?page=fi:Jarkko_Nieminen
but I then copied the whole page without saving and changed to NWE and pasted the content there and then saved the changes.

In the second edit, I only changed order of text (https://meta.wikimedia.org/w/index.php?title=Steward_requests/Permissions&diff=prev&oldid=16197726) and fixed a few parameters, and NWE made some unneeded changes that broke the template.

In T152671 "All empty lines have been removed." In my examples, not.

I now can reproduce:

  1. Copy some text with 2 or more consecutive spaces (either from the VE surface itself or from somewhere else, e.g. your text editor). Actually, just 2 spaces are enough to reproduce the bug.
  2. Insert them in VE (both reproducible in visual and source mode, also both with Ctrl-V and Ctrl-Shift-V).

Expected result: The spaces are inserted as spaces (i.e. as U+0020).
Actual result (at least in Firefox): The spaces are inserted as NBSPs.

Jdforrester-WMF renamed this task from NWE breaks templates by adding some extra space to In Firefox (?), pasting multiple spaces (U+0020) instead pastes NBSPs, which breaks e.g. template formatting.Jan 3 2017, 8:14 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set the point value for this task to 1.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

I could reproduce it with Chromium as well, it’s apparently not limited to Firefox!

Jdforrester-WMF renamed this task from In Firefox (?), pasting multiple spaces (U+0020) instead pastes NBSPs, which breaks e.g. template formatting to Pasting multiple spaces (U+0020) instead pastes NBSPs, which breaks e.g. template formatting.Feb 9 2017, 6:56 PM
Jdforrester-WMF raised the priority of this task from Medium to High.
Jdforrester-WMF subscribed.

Just replicated this in Chrome with a regular paste on text/plain into NWE – https://en.wikipedia.beta.wmflabs.org/w/index.php?title=User:Jdforrester_(WMF)/sandbox&oldid=351448

Change 336939 had a related patch set uploaded (by Esanders):
Replace non-breaking spaces when pasting into source

https://gerrit.wikimedia.org/r/336939

Change 336939 merged by jenkins-bot:
Replace non-breaking spaces when pasting into source

https://gerrit.wikimedia.org/r/336939

Change 337417 had a related patch set uploaded (by Jforrester):
Update VE core submodule to master (2f38291c4)

https://gerrit.wikimedia.org/r/337417

Change 337417 merged by jenkins-bot:
Update VE core submodule to master (2f38291c4)

https://gerrit.wikimedia.org/r/337417