Type of activity: Pre-scheduled session.
Main topic: Handling wiki content beyond plaintext
The problem
The current architecture of mediawiki entangles the markup language and the template mechanism. A more structured semantics for templates, organized around the HTML DOM structure of the resulting document, prevents common errors (like leading boldface out of a template), allows for more efficient page updates, and paves the way for alternative markup languages in the future.
Expected outcome
An agreement on refactoring template support out of the parser and a new template semantics, along with a roadmap towards achieving this long-term goal.
Current status of the discussion
A number of related proposals have been made, with consensus among smaller communities.
- The wikitext 2.0 proposal by @ssastry includes DOM-based semantics for templates (T149282)
- @cscott's "Zero Parsers in Core" proposal includes separating the parser and template APIs
- The parsing team's plan for efficient template update relies on alternative template semantics (although the implementation may simply detect when these new template semantics can be used without changing the render). Discussion in T130567: WIP RFC: Hygienic transclusions for WYSIWYG, incremental parsing & composition: Options and trade-offs
- The {{#balance}} proposal (T114445: [RFC] Balanced templates) enforces new template semantics based on declarations in template *definitions*
- An alternative to {{#balance}} which declares new semantics at *use site* has been mooted. See https://www.mediawiki.org/wiki/User:SSastry_%28WMF%29/Notes/Document_Composability#How_are_DOM_fragments_identified_during_parse.3F