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).

Event Timeline

cscott created this task.Jul 24 2015, 5:21 PM
cscott raised the priority of this task from to Medium.
cscott updated the task description. (Show Details)
cscott added a project: Parsoid.
cscott added a subscriber: cscott.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 24 2015, 5:21 PM
cscott updated the task description. (Show Details)Jul 28 2015, 7:15 PM
cscott set Security to None.

How common is this usage?

LGoto moved this task from Needs Triage to Backlog on the Parsoid board.Feb 15 2020, 9:43 PM
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptFeb 15 2020, 9:43 PM
LGoto moved this task from Backlog to Known Differences on the Parsoid board.Jun 11 2020, 6:23 PM