Page MenuHomePhabricator

Edge case category link output difference
Closed, ResolvedPublic

Description

See below. Found on scandium.

[subbu@earth:~/work/wmf/parsoid] echo "[[Category:Foo|0]]" | parse.js --body_only
<link rel="mw:PageProp/Category" href="./Category:Foo#0" data-parsoid='{"stx":"piped","a":{"href":"./Category:Foo"},"sa":{"href":"Category:Foo"},"dsr":[0,18,null,null]}'/>

[subbu@earth:~/work/wmf/parsoid] echo "[[Category:Foo|0]]" | php bin/parse.php --body_only
<link rel="mw:PageProp/Category" href="./Category:Foo" data-parsoid='{"stx":"piped","a":{"href":"./Category:Foo"},"sa":{"href":"Category:Foo"},"dsr":[0,18,null,null]}'/>

Event Timeline

ssastry triaged this task as Medium priority.Oct 24 2019, 5:24 PM
ssastry created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 24 2019, 5:24 PM

But check with "|1" instead of "|0":

[subbu@earth:~/work/wmf/parsoid] echo "[[Category:Foo|1]]" | php bin/parse.php --body_only
<link rel="mw:PageProp/Category" href="./Category:Foo#1" data-parsoid='{"stx":"piped","a":{"href":"./Category:Foo"},"sa":{"href":"Category:Foo"},"dsr":[0,18,null,null]}'/>

So, probably some bad falsy value check.

ssastry assigned this task to Sbailey.Dec 12 2019, 5:17 PM

Change 557149 had a related patch set uploaded (by Sbailey; owner: Sbailey):
[mediawiki/services/parsoid@master] Fix for "0" in category link output not being present

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

Change 557149 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Fix for "0" in category link output not being present

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

Sbailey closed this task as Resolved.Dec 16 2019, 3:29 PM