Page MenuHomePhabricator

VisualEditor: Return of the whitespace bunny-hopping bug
Closed, ResolvedPublic

Description

This mess:

[[Help:Installing Japanese character sets|<span class="t_nihongo_icon" style="color: #00e; font: bold 80% sans-serif; text-decoration: none; padding: 0 .1em;">?</span>]]) [[Category:Articles containing Japanese-language text]]

was added in https://en.wikipedia.org/w/index.php?curid=31216768&diff=621842944&oldid=600210359

to produce this:

;Track & road events<ref name="JAAF20120611">[http://www.jaaf.or.jp/fan/news/2012/20120611.html {{Nihongo||ロンドンオリンピック トラック・フィールド種目・競歩種目の日本代表選手|The Japanese national team of Track & Field and Race Walk at the 2012 Olympic Games}}][[Help:Installing Japanese character sets|<span class="t_nihongo_icon" style="color: #00e; font: bold 80% sans-serif; text-decoration: none; padding: 0 .1em;">?</span>]]) [[Category:Articles containing Japanese-language text]]{{ja icon}}. Japan Association of Athletics Federations (2012-06-11). Retrieved 19 June 2012.</ref>

The editor says s/he didn't edit this line.


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=69876

Details

Reference
bz69861

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:33 AM
bzimport set Reference to bz69861.

Ugh, I found the cause, it's another whitespace bunny-hop bug.

This whole mess is made because we have something like )[category] <span> and it gets turned into ) [category]<span> . The space jumps to the other side of the category.

Additionally, there's a template leakage bug in Parsoid here. That parenthesis, category, space and span tag should have been marked as template-generated content but aren't. This means that if you try to edit this reference, Parsoid will make a big mess of it. As long as you don't edit it, it'll be fine, but the space jump bug in VE causes it to be edited.

gerritadmin wrote:

Change 155634 had a related patch set uploaded by Catrope:
Fix the newline bunny-hop bug harder

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

(In reply to Gerrit Notification Bot from comment #2)

Change 155634 had a related patch set uploaded by Catrope:
Fix the newline bunny-hop bug harder

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

This addresses the VE part of the bug. With this patch, VE will no longer corrupt whitespace around categories and the like (I've been seeing this a bunch in needcheck diffs, so that should fix those too). This will prevent Parsoid from corrupting the reference on this page, *unless* you edit it, in which case it'll still get messed up. I'll file a Parsoid bug for that.

gerritadmin wrote:

Change 155634 merged by jenkins-bot:
Fix the newline bunny-hop bug harder

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