Page MenuHomePhabricator

Parsoid treats invalid titles in <gallery> differently to legacy parser
Closed, ResolvedPublic

Description

If the title is invalid, for example contains two colons:

<gallery>
File::Example.jpg
File:Example.jpg
</gallery>

Parsoid will output an item as if the image were missing:

image.png (163×320 px, 30 KB)

Legacy parser will drop the item completely:

image.png (168×164 px, 27 KB)

Event Timeline

ssastry added a project: Parsoid-Rendering.
ssastry moved this task from Needs Triage to Bugs & Crashers on the Parsoid board.

Parsoid and the legacy parser have the same check in the gallery,
https://github.com/wikimedia/mediawiki/blob/master/includes/parser/Parser.php#L5035-L5039
https://github.com/wikimedia/parsoid/blob/master/src/Ext/ParsoidExtensionAPI.php#L759-L767

And the test "Gallery" has an example like,

<gallery>
...
[[x|xx]]]]
...
</gallery>

where the line gets dropped for being an invalid title.

The problem here is specific to Parsoid's Title class. The same problem occurs with wikilink syntax,

[[File::Example.jpg]]

should render as plaintext but Parsoid produces a figure with a missing image.

Change 622432 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Title with leading colon is invalid

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

Change 622432 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Title with leading colon is invalid

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

Change 625641 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a8

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

Change 625641 merged by jenkins-bot:
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a8

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