Parsoid/Todo:Extension tag precedence

From mediawiki.org

Tracked in bugzilla:40604.

Test case:

{{echo<ref>}}Foo{{echo|</ref>}}

The ref overrides the template syntax.

Implementation idea: Rule out the nesting of non-HTML tags within attributes in the grammar. This includes template parameters.

More test cases:

{{echo|<gallery>}}Foo....

<gallery> <!-- </gallery> -->
<gallery> <pre> </gallery> </pre>
<gallery>  </gallery> 

The gallery tag needs to have precedence over all of these.

Older notes[edit]

Make sure that (potential) extension end tags are always matched, even if parsing the content causes a switch to a plain-text parsing mode. An example would be an unclosed html comment (<!--) in content between extension tags. Idea: Treat any non-html tags as potential extension tags, and handle unbalanced comments and nowiki sections accordingly. In other words, give unknown html tags precedence over unbalanced / unclosed comments or nowiki blocks.