Page MenuHomePhabricator

Parsoid fails to parse wikilink because of broken extlink
Closed, ResolvedPublic

Description

Pulled from https://parsoid-vs-core.wmflabs.org/diff/dsbwiki/Welar

Ex.

[[Test|[123]]]

Extlink tokenizing skips the Utils::isProtocolValid check in the presence of an entity (the skip is really supposed to be for the presence of templates but isn't trying hard enough) so

λ (master) echo "[123]]" | php bin/parse.php --trace peg
0-[peg]        | ---->    [{"type":"SelfclosingTagTk","name":"extlink","attribs":[{"k":"href","v":["123",{"type":"TagTk","name":"span","attribs":[{"k":"typeof","v":"mw:Entity"}],"dataParsoid":{"src":"]","srcContent":"]","tsr":[4,4]}},"]",{"type":"EndTagTk","name":"span","attribs":[],"dataParsoid":{"tsr":[9,9]}}],"srcOffsets":[1,1,1,9]},{"k":"mw:content","v":"","srcOffsets":[9,9,9,9]},{"k":"spaces","v":""}],"dataParsoid":{"tsr":[0,10]}}]

and then we bail on the extlink in the token transforms. Unfortunately, that's too late to give back the closing ] to match the wikilink above.

Related Objects

Event Timeline

ABreault-WMF triaged this task as Medium priority.

Change #1196782 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] [WIP] Non extlink in wikilink

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

Change #1196782 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Non extlink in wikilink

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

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

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.22.0-a28

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

Change #1197319 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.22.0-a28

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