Page MenuHomePhabricator

Typisch Vlaams (Citeer TypVla) citations erroneously considered with identical keys on nlwiktionary
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

On nlwiktionary, add the following wikitext on a sandbox page:

{{Citeer TypVla|pagina=3 col 4|titel=title 1}}
{{Citeer TypVla|pagina=3 col  4|titel=title 2}}

(Note the extra space in the pagina argument)
Render the page with Parsoid (useparsoid=1) and with the legacy parser (useparsoid=0)

What happens?:

On the Parsoid rendering, a single reference with an error is generated.

On the legacy parser rendering, two different references are generated, no error is emitted.

What should have happened instead?:

Errors should be emitted consistently.

Note

This stems from the fact that the Citeer TypVla template uses the page number as primary key for the name reference. Adding a space has been used on legacy parser to distinguish between different references that happened on the same page, but this doesn't work in Parsoid as that space gets normalized out during processing (at least around the extension parameter passing; possibly elsewhere).

The behaviour is not entirely consistent in legacy, as

<ref name="hello world">a</ref>
<ref name="hello  world">b</ref>

also triggers an error there, as well as some other template constructions with these elements.

Recommendation

Considering the fact that "hello world" and "hello world" are considered as the same name in legacy parser, the usage of the template looks like using an undocumented/accidental bug rather than something we would wish to support explicitly. Modifying the template to add more distinguishing features to the generated reference name is probably an adequate fix here.

Event Timeline

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

Change #1126572 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/services/parsoid@master] Do not normalize internal whitespace in extension options values

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

Change #1127524 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/extensions/Cite@master] Do not normalize spaces in name/follows/details ref attributes

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

Change #1126572 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Make whitespace normalization of extension options configurable

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

Change #1128442 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.21.0-a21

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

Change #1128442 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.21.0-a21

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

Change #1130164 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/services/parsoid@master] Tweak extension argument normalization API

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

Change #1130164 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Tweak extension argument normalization API

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

Change #1130555 had a related patch set uploaded (by Isabelle Hurbain-Palatin; author: Isabelle Hurbain-Palatin):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.21.0-a22

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

Change #1130555 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.21.0-a22

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

nlwiktionary has edited their template and the issue is solved.

Change #1127524 abandoned by Isabelle Hurbain-Palatin:

[mediawiki/extensions/Cite@master] Do not normalize spaces in name/follows/details ref attributes

Reason:

I don't need this patch anymore myself; if anyone else does, feel free to ressucitate

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