Page MenuHomePhabricator

VisualEditor: Editing a block level slug causes pawns to be inserted, content corruption
Closed, ResolvedPublic

Description

Lately, I've been noticing random pawn characters at the end of paragraphs all over English Wikipedia. The source of these pawns was a mystery to me until I tried using the Visual Editor today. As soon as I started typing in the editor, it inserted a pawn at the end of the line I was editing.

The pawn in question is the white pawn, typically the first piece to move in a game of chess. This makes me wonder if perhaps the visual editor has become sentient and is trying to initiate a friendly game with the editor. Unfortunately, playing chess on Wikipedia was banned in 2006 as a violation of WP:NOT,[1] so it's probably a good idea if we eliminate this sort of behavior.

Actual character: ♙
Unicode value: 2659
UTF-8 value: E2 99 99
Browser: Firefox

  1. https://en.wikipedia.org/wiki/Wikipedia:Miscellany_for_deletion/Wikipedia:Chess_championship

Version: unspecified
Severity: critical

Details

Reference
bz48346

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 1:27 AM
bzimport set Reference to bz48346.

Steps to reproduce:

  1. Log in and turn on the visual editor.
  2. Go to a random article like "Sundance Meadows Airport"
  3. Click the Edit tab
  4. After the cursor appears on the page, type a character

You will then see a white pawn at the end of the line of text you are editing.

Interestingly, it only seems to happen on articles that insert the cursor into a blank line at the top of the article. I'm not sure what determines that behavior, but it seems to be the behavior for the vast majority of en.wiki articles. The only article I haven't been able to reproduce the bug at so far is Lalage:
https://en.wikipedia.org/wiki/Lalage

Confirmed in Safari and Chrome as well.

Can't reproduce this is master. It may have already been fixed, pending release?

(In reply to comment #1)

Steps to reproduce:

  1. Log in and turn on the visual editor.
  2. Go to a random article like "Sundance Meadows Airport"
  3. Click the Edit tab
  4. After the cursor appears on the page, type a character

You will then see a white pawn at the end of the line of text you are
editing.

Thanks; have updated the bug report accordingly.

Interestingly, it only seems to happen on articles that insert the cursor
into a blank line at the top of the article. I'm not sure what determines
that behavior, but it seems to be the behavior for the vast majority of
en.wiki articles.

That is bug 47790. It's not really a blank line in the document; it's the "potential" place to insert some new content, until you click into it and insert some, at which point it's whatever you type in. But it's not really very obvious to users what it is.

The only article I haven't been able to reproduce the bug at so far
is Lalage:
https://en.wikipedia.org/wiki/Lalage

A block-level slug only appears if the page starts with a template or other kind of generated content; any page that starts with one will get one (hence the pervasiveness). The alternative is not giving users the ability to insert content before a template if it happened to be at the start of a document, which would be even more confusing.

(In reply to comment #4)

Pawn insertion from May 3:
https://en.wikipedia.org/w/index.
php?title=Rubik%27s_360&diff=553360286&oldid=540708795

These kind of issues are precisely why there's a mandatory pre-save diff for users to read and agree it's fine. If there's a pawn inserted into the article, you're not meant to press save!

Confirming that this is fixed in master and wmf4; deployed in the normal deployment train.

verified for any page https://test2.wikipedia.org/

using chrome Version 26.0.1410.65 and firefox 25.