Page MenuHomePhabricator

Handle interwiki links in media `link=` params
Open, MediumPublic

Description

In https://gerrit.wikimedia.org/r/#/c/396067/ @cscott exposed this,

$ echo "[[File:Foobar.jpg|alt=galleryalt|link=meatball:Link]]" | node bin/parse --normalize
<p><figure-inline><a href="Meatball:Link"><img alt="galleryalt" src="//upload.wikimedia.org/wikipedia/commons/3/3a/Foobar.jpg" data-file-width="240" data-file-height="28" data-file-type="bitmap"  height="28" width="240"/></a></figure-inline></p>

In handleInfo, the o.hasLink case (https://github.com/wikimedia/parsoid/blob/master/lib/wt2html/tt/LinkHandler.js#L1432-L1459) probably needs a call to getWikiLinkTargetInfo instead of just the makeTitleFromText

Event Timeline

Arlolra triaged this task as Medium priority.Dec 12 2017, 2:32 AM
ssastry lowered the priority of this task from Medium to Low.Feb 28 2020, 5:14 PM
ssastry moved this task from Link syntax (links & media) to Bugs & Crashers on the Parsoid board.

T18409 is another case that would benefit from a call to getWikiLinkTargetInfo

Change #1095481 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/services/parsoid@master] WIP: Fix media with `link=` pointing to an interwiki link

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