Use case
As a user, I'd like to guide and validate user input so that each input is always valid.
Background
Input masks provide a way to validate and indicate the exact format of the data entered, for example:
- Telephone - (___) ____ ____
- Zip code - ___ ____
- email, barcode, ISBN, color codes, etc
A good example of this is microsoft word inputmasks or alternatively actual html5 patterns. While it is possible to implement this for each of those, there are an infinite number of ways to require input.
Proposed solution:
Add a new field(s) to templatedata that governs the exact input. For example:
<templatedata> params": { "phone": { "label": "Phone", "type": "number" "inputmask" : "(000) 000-0000", "usemask-output" = "false" }, } </templatedata>
Once the page is saved, the input is normalized to the basic wikitext, e.g. "phone = 123123123", and vice versa when the template dialog is loaded. Alternatively, for certain templates it could output it as shown when using the usemask-output parameter.