After the changes from T101075, when you add a template parameter in VisualEditor but leave its value empty, that parameter will be removed from the template transclusion. This is good in most cases, but some wikitext templates make a distinction between parameters that are not present at all, and parameters that are present but empty.
For those parameters we should be able to specify the desired behavior in TemplateData:
- Allow empty parameter
- Remove empty parameter
- Unspecified (which would use the current behavior: remove empty parameter when it's newly added, otherwise allow)
Also, this needs to interact sensibly with required parameters: (I realize that these combinations are confusing, perhaps there's a better way to word this?)
- When a required parameter is also allowed to be empty, VisualEditor should only ensure that it's present, but allow it to be empty
- When a required parameter is supposed to be removed when empty, VisualEditor should allow it to be missing, but not allow it to be empty
- When a required parameter's behavior when empty is unspecified, VisualEditor behave like it does now (ensure it's present, not allow it to be empty)
I'm not sure how this actually should be represented in the TemplateData JSON. Opinions welcome.
Use cases:
- Infoboxes on Polish Wikipedia (discussed in T276989), where the convention is to include all parameters in the wikitext (even when empty) to make them easier to fill in in the wikitext editors
- Various templates on English Wikipedia and Wikisource (discussed in T101075#6859819), where empty parameter values are used to disable/suppress some parts of the output