Page MenuHomePhabricator

AddMediaInfo pass isn't robust to link-in-link
Closed, ResolvedPublic

Description

For example, both inline

> [http://www.google.com [[File:Test.jpg|123]]]

TypeError: Cannot read property 'firstChild' of null
    at containers.filter (~/services/parsoid/lib/wt2html/pp/processors/AddMediaInfo.js:586:23)

and block break,

> [http://www.google.com [[File:Test.jpg|thumb|123]]]

TypeError: Cannot read property 'nodeName' of null
    at containers.filter (~/services/parsoid/lib/wt2html/pp/processors/AddMediaInfo.js:586:34)

Event Timeline

http://localhost:8000/nl.wikipedia.org/v3/page/html/De_Meern/53147456 give this example,

== Externe link ==
*[http://api.commissiemer.nl/docs/mer/p23/p2331/2331-035cultuurhistorie_001.pdf {{pdf}} Polder Rijnenburg - Cultuurhistorische landschapsanalyse (2007) - commissiemer.nl]

TypeError: Cannot read property 'firstChild' of null
    at containers.filter (~/services/parsoid/lib/wt2html/pp/processors/AddMediaInfo.js:586:23)
Arlolra triaged this task as Medium priority.Feb 11 2019, 10:42 PM

Change 489915 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Fix crashers from file in link scenarios

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

Change 489915 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Fix crashers from file in link scenarios

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