Page MenuHomePhabricator

Categories (and possibly other start-of-line transparent wikitext) that follow indent-pre wikitext get absorbed into <pre> tags and don't round-trip
Open, NormalPublic

Description

See below:

[subbu@earth:~/work/wmf/parsoid] echo -e " foo\n[[Category:Bar]]" | parse.js --body_only
[warn/dsr/inconsistent][enwiki/Main Page] DSR inconsistency: cs/s mismatch for node: PRE s: 1 ; cs: 0
<pre data-parsoid='{"dsr":[0,21,1,0]}'>foo
<link rel="mw:PageProp/Category" href="./Category:Bar" data-parsoid='{"stx":"simple","a":{"href":"./Category:Bar"},"sa":{"href":"Category:Bar"},"dsr":[5,21,null,null]}'/></pre>

[subbu@earth:~/work/wmf/parsoid] echo -e " foo\n[[Category:Bar]]" | parse.js --wt2wt
[warn/dsr/inconsistent][enwiki/Main Page] DSR inconsistency: cs/s mismatch for node: PRE s: 1 ; cs: 0
 foo
 [[Category:Bar]]

This bug has probably been there since start-of-Parsoid-time. It is just that is rarely, if ever, encountered because of selective serialization. Because of T225217, since we are now running full normalizing serialization, this bug got exposed.

Original bug description:

See the following edits (sorry about them being on a staff-only wiki, posting screenshots too):

These edits were all made with VE, and each of them added another space to the start of the line containing [[Category:Humor]] at the bottom, as well as to the whitespace-only line before it.

It looks like the first space on this line originated from a big whitespace normalization edit made by VE earlier: https://office.wikimedia.org/w/index.php?diff=prev&oldid=252444

Event Timeline

Catrope created this task.Jun 11 2019, 6:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 11 2019, 6:18 PM
ssastry renamed this task from Escalating whitespace before a category, increasing with each edit to Categories (and possibly other start-of-line transparent wikitext) that follow indent-pre wikitext get absorbed into <pre> tags and don't round-trip.Jun 12 2019, 9:54 PM
ssastry triaged this task as Normal priority.
ssastry updated the task description. (Show Details)