To be crystal clear, this is an idea, not a proposal.
The motivation is solving the custom element upgrade step through JavaScript, while also allowing other syntaxes to be mixed with HTML if so desired. The macro
element generates a sequence of tokens that can be processed by JavaScript.
document.getMacro().then(function(macro) {
// This should probably be asynchronous so large macros can be done incrementally
for(let token of macro.tokens) {
// Let's build a tree, or reparse tokens Markdown-style...
...
}
}
...
<macro>
<hi> <b> ... </b> </hi>
</macro>