Page MenuHomePhabricator

Parsoid does not interpret default parameters on non-transcluded pages the same way as the MW parser
Closed, ResolvedPublic

Description

Using the {{{size|...}} parameter in an image isn't working in flow. Many templates use this method for optional overrides.
E.g. http://en.wikipedia.beta.wmflabs.org/wiki/Topic:S8yrrd31knh3nakg

Compared with how it should render
http://en.wikipedia.beta.wmflabs.org/w/index.php?title=User:Quiddity/sandbox&oldid=177898

Screenshot of the problem in Flow. The image should only be {{{size|48px}}} but it's displaying fullsize:

DY2qi3I.png (927×807 px, 71 KB)

Event Timeline

Quiddity raised the priority of this task from to Needs Triage.
Quiddity updated the task description. (Show Details)
Quiddity subscribed.

This is not really an issue in this case, since we can just use:

[[File:example.svg|48px]]

However, this does seem to be a Parsoid parity issue (albeit not one where there is an absolute requirement for the feature). It seems the issue is that the MW parser defaults parameters even when the page is not being transcluded (see http://en.wikipedia.beta.wmflabs.org/w/index.php?title=User:Mattflaschen/Sandbox&oldid=177905).

I confirmed the Flow behavior applies to VE too (try editing the page above).

Note, the syntax from @Quiddity's linked page (I can't view-source for the Flow post, unfortunately, but I assume it's the same) is:

{| style="margin: 1em auto 1em auto;border: 2px solid darkgray;" cellpadding="10"
|[[File:example.svg|{{{size|48px}}}]]
|style="vertical-align:middle"|
test 
|}
Mattflaschen-WMF renamed this task from Parameter not used properly in Flow to Parsoid does not interpret default parameters on non-transcluded pages the same way as the MW parser.Dec 30 2014, 11:35 PM
Mattflaschen-WMF set Security to None.

Confirmed as follows:

[subbu@earth lib] echo "[[File:Foo.jpg|{{{foo|48px}}}]]" | node parse --normalize
<p><span><a href="File:Foo.jpg"><img src="//upload.wikimedia.org/wikipedia/commons/0/06/Foo.jpg" height="197" width="300"/></a></span></p>

[subbu@earth lib] echo "[[File:Foo.jpg|48px]]" | node parse --normalize
<p><span><a href="File:Foo.jpg"><img src="//upload.wikimedia.org/wikipedia/commons/0/06/Foo.jpg" height="32" width="48"/></a></span></p>
ssastry triaged this task as Medium priority.Dec 31 2014, 9:45 PM
ssastry added a subscriber: cscott.