Independent of whether wikifunctions usage in wikitext is going to be a parser function or an extension tag, we want to ensure that clients (specifically editing clients like VE) can easily identify wikifunction markup so as to provide dedicated editing support for their usage.
**Context**: Parsoid's current HTML spec doesn't have any special support for parser function markup -- they are currently represented with a "mw:Transclusion" typeof attribute with the data-mw attribute embedding the knowledge of the parser function deep inside the attribute. Since we cannot reasonably change this representation without a breaking version change, it makes more sense to use his opportunity to prototype a better representation for parser functions that we can migrate everything over to at a future date.
Current plan, as of 2025-01-29:3-17:
|| Before: Attribute/sub-value (`jq` notation) | Beforre: Value | After: Attribute | After: Value | Change |
| --- | --- | --- | --- | --- |
| `typeof` | `mw:Transclusion` | `typeof` | `mw:Transclusion mw:ParserFunction` | Add `mw:ParserFunction` |
| `data-mw.parts[0].template.target` | `{"wt":"padleft:xyz","function":"padleft"}` | `{"wt":"padleft","pf":"padleft"}` | `function` -> `pf`; `wt` has zeroth param moved out |
| `data-mw.parts[0].template.params` | `{"1":{"wt":"4"},"2":{"wt":"-"}}` | `{"1":{"wt":"xyz"},"2":{"wt":"4"},"3":{"wt":"-"}}` | Zeroth param in `wt` is now first param,parserfunction.target` | `{"wt":"#padleft","key":"padleft"}` | `template` -> `parserfunction` ; `function` -> `key`; others renumbed |`wt` has zeroth param moved out |
| `data-mw.parts[0].template.params` | `{"1":{"wt":"4"},"2":{"wt":"-"}}` | `data-mw.parts[0].template.params` | `{"1":{"wt":"xyz"},"2":{"wt":"4"},"3":{"wt":"-"}}` | Zeroth param in `wt` is now first param, others renumbered |
Note also that the `data-mw.parts[0].parserfunction.target.wt` value will have the `#` included iff the original wikitext did, but the `key` is the magic word ID and will never have a `#`.