Given the following wikitext: <h2 id="attr">text</h2>
We get very different parser outputs:
Parsoid: | <h2 id="attr">text</h2> |
Legacy parser, legacy heading mode: | <h2 id="attr"><span class="mw-headline" id="text">text</span></h2> |
Legacy parser, new heading mode: | <h2 id="text" id="attr">text</h2> |
Also, the link in the TOC goes to #attr in Parsoid, but to #text in legacy parser in both modes.
We definitely should fix legacy parser's new heading mode to not output a duplicate attribute. The other inconsistencies may be acceptable, but seem worth considering.