Page MenuHomePhabricator

VisualEditor should not insert empty parameters from the TemplateData dialog
Closed, DuplicatePublic

Description

This refers to a discussion at https://en.wikipedia.org/wiki/Help_talk:Citation_Style_1#TemplateData

Currently if a template parameter is marked as suggested then the TemplateData editor will always insert the parameter even if the no value is entered for the dialog.

For example the {{Cite web}} template has a archiveurl parameter. Some users would like this to be marked as suggested in the TD to encourage people to fill this in. If a user does not fill it in then the dialog produces

{{cite web | archiveurl= |...}}

this makes the wikitext look ugly for the many users who still use wikitext.

Ideally the dialog would supress including parameters when no value is specified.

Event Timeline

Note that there are nuances to this. For instance, when editing an existing citation using VE, any existing (in wikimarkup) empty parameters that are present should not be removed. There may be other such gotchas that I'm not thinking of right now. Perhaps the most surgical (least risk) approach would be to "remove" (not insert) empty parameters if and only if they were added to the editing interface by VE due to being "suggested" in the TemplateData.

Duplicate of T101075, I think? There's discussion there on some of the gotchas, certainly.

Duplicate of T101075, I think? There's discussion there on some of the gotchas, certainly.

Yeah, I think so. I felt like there was another task for this when I went over it in the weekly triage, but I couldn't find it at the time. Thanks!