Page MenuHomePhabricator

Media link with template
Closed, ResolvedPublic

Description

From https://www.mediawiki.org/wiki/Help_talk:Lint_errors/bogus-image-options#False_positives

$ echo "[[File:Test.jpg|link=http://test{{1x|345}}|odd]]" | php maintenance/run parse
<p><span class="mw-default-size" typeof="mw:File"><a href="http://test345" title="odd" rel="nofollow"><img alt="odd" src="https://upload.wikimedia.org/wikipedia/commons/2/28/JPG_Test.jpg" decoding="async" width="1733" height="2601" class="mw-file-element" /></a></span>
</p>

$ echo "[[File:Test.jpg|link=http://test{{1x|345}}|odd]]" | php maintenance/run parse --parsoid
<section data-mw-section-id="0" id="mwAQ"><p id="mwAg"><span class="mw-default-size" typeof="mw:File mw:Placeholder" id="mwAw" data-mw='{"caption":"odd"}'><a href="http://test{{1x" rel="nofollow" title="odd" id="mwBA"><img alt="odd" resource="http://ve:8080/wiki/File:Test.jpg" src="https://upload.wikimedia.org/wikipedia/commons/2/28/JPG_Test.jpg" decoding="async" data-file-width="1733" data-file-height="2601" data-file-type="bitmap" height="2601" width="1733" class="mw-file-element" id="mwBQ"/></a></span></p>
</section>

Event Timeline

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

[mediawiki/services/parsoid@master] Support templates in link media option

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

Change #1275516 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Support templates in link media option

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

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

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a29

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

Change #1277671 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a29

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

Note that while the patch fixed the rendering, there may be roundtripping issues with templated link
https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/1275516/4/tests/parser/media.txt#864