Parser 2011/Stage 3: Expansion

Template expansion
very prelim :D

The page:

The Template:Hello page:

Now we can expand the lot into something like:

(Or should the content nodes just include a reference to the template param? or?)

Rendering attachment
It's not uncommon to have structures in wikitext, especially when templates are involved, where separate 'start' and 'end' points cross some hierarchical lines. For instance:


 * extra stuff
 * manually added
 * manually added

This gives us a structure something like:

template: start-fancy-table table tr, th, /th, th, /th, /tr template: a-table-row tr, td, /td, td, /td, /tr template: a-table-row tr, td, /td, td, /td, /tr tr, td, td template: end-fancy-table tr, td, /td, td, /td, /tr /table

Depending on the actual template structure, the various bits may all appear on different 'levels'. HTML would generally whinge at this sort of structure directly translated. :)

When rendering this to output or showing an editor, it's necessary to go through the output and pair up matching open/close pairs for these things so proper output nesting can be created.