Page MenuHomePhabricator

Provide a neater way to edit transclusions that do not take a pipe (e.g. {{formatnum:…}}, {{lc:…}}, {{int:…}}, {{#dateformat:…}}})
Open, MediumPublic

Description

If I try to edit a number in a {{formatnum:…}}, the VisualEditor displays the template’s edition window, saying it is (for example) the 'formatnum:959719' template, without any parameter. So if I want to change the number, I need to remove the 'template' and then to add a new one, for example 'formatnum:958719'.

The editor should allow changing the number without having to remove the 'template'.

Details

Reference
bz49954

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:47 AM
bzimport set Reference to bz49954.

"{{formatnum:…}} is not a template" - true

For this, Parsoid takes wikitext like:

This was {{formatnum:1234567890}} years ago.

… and gives us HTML of:

<p data-parsoid="…">This was <span about="#mwt1" typeof="mw:Transclusion" data-mw="{'target':{'wt':'formatnum:1234567890','function':'formatnum'}" data-parsoid="…">1,234,567,890</span> years ago.</p>

… so maybe we'd want to special-case on 'function':'formatnum' so that they're easier to edit?

Danmichaelo renamed this task from VisualEditor: Provide a neater way to edit transclusions that do not take a pipe (e.g. {{formatnum:…}}) to VisualEditor: {{formatnum:…}}) cannot be edited.Jun 28 2017, 8:06 PM
Danmichaelo raised the priority of this task from Low to Medium.

Was hit by this limitation when I was editing an article now. Couldn't find any way to edit the number except to delete it, so I changed the title to reflect that.

Was hit by this limitation when I was editing an article now. Couldn't find any way to edit the number except to delete it, so I changed the title to reflect that.

Thanks for the input, but please don't make bugs less general. You can add further examples of how they affect you, but that should be as a comment or in the description, not removing other things that are already covered by this task. For instance, this also applies to the #dateformat, lc, and int transclusion objects.

Jdforrester-WMF renamed this task from VisualEditor: {{formatnum:…}}) cannot be edited to Provide a neater way to edit transclusions that do not take a pipe (e.g. {{formatnum:…}}, {{lc:…}}, {{int:…}}, {{#dateformat:…}}}).Jun 29 2017, 2:24 PM
Jdforrester-WMF updated the task description. (Show Details)

Related: T204370: Behavior switch/magic word uniformity and T204371: Replace initial colon in (hash-prefixed) parser function invocation with vertical bar, although VE would probably still have to know enough to translate the 'old style' syntax into the newer uniform syntax.