Page MenuHomePhabricator

Templated template argument names aren't handled
Open, MediumPublic

Description

$ echo '{{echo|{{echo|1}}=foo}}' | php maintenance/parse.php 
<p>foo
</p>

But:

$ echo '{{echo|{{echo|1}}=foo}}' | tests/parse.js --normalize=parsoid
<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"{{echo|1}}":{"wt":"foo"}},"i":0}}]}'>foo</p>

Note that Parsoid thinks the name of the parameter is {{echo|1}} -- it is failing to expand the template in the parameter name slot.

I think this probably *should* generate something like:

<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"{{echo|1}}"}}},"i":0}}]}'>foo</p>

And when addHTMLTemplateParameters is turned on, the key property should also get an html key (so that we can recursively expand/edit the template).