Parsoid/Todo:Extension tag precedence

Tracked in 40604.

Test case:

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|

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

Older notes
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.
 * Did some statistics on a dump of the English Wikipedia: There are about 10000 non-html/wiki end-tags, and none of them is preceded by an unclosed comment on the same line. List of end tags: en:User:GWicke/Martian endtags. So this strategy looks quite safe. GWicke (talk) 20:11, 20 February 2012 (UTC)