Last modified: 2013-07-04 10:35:16 UTC
The VE issue of tables listing prime ministers of Canadian provinces not being alienated was originally reported as bug 43076 comment 1. It was off topic there (bug 43076 is about aliens not behaving correctly), so I'm moving it here because the root cause is a Parsoid bug. See http://parsoid.wmflabs.org/en/List_of_premiers_of_British_Columbia . The table is generated by a template, like so: {{Canadian first minister list/top}} {{Canadian first minister list |name = [[John Foster McCreight]] |number = 1 |image = McCreight.JPG [...] |accomplishments = }} [...] {{Canadian first minister list/bottom|notes= :{{note_label|minority|Min.}} [[Minority government]] :{{note_label|coalition|Co.}} [[Coalition government]] }} The HTML that Parsoid produces for this looks like: <span data-parsoid="[LOTS of stuff, seems to be all template invocations in the entire table]" about="#mwt9" typeof="mw:Object/Template "> </span><table class="wikitable" about="#mwt9"> <tbody><tr data-parsoid="{"startTagSrc":"|-","dsr":[null,4540]}"> <th> No. </th> [more <th>s] </tr><tr style="background: #eee;" data-parsoid="[template invocation for this row]"> [<td>s] </tr> <meta typeof="mw:Placeholder" data-parsoid="{"src":"</tr>"}" /> <tr data-parsoid="{"stx":"html"}"> [etc.] Note the <meta typeof="mw:Placeholder"> tag right after the </tr>, representing what is presumably a literal "</tr>". However, this </tr> wasn't in the source itself, it was generated by a template. I thought Parsoid had been fixed not to produce these <meta>s for template-generated table elements? This breaks VE because browsers don't like <meta> inside <tbody> (Firefox marks the meta tag red in its source view). In the DOM that VE gets, the <meta>s have been moved to right above the <table>. This places them between the <span> and the <table>, and because they don't have about="#mwt9", the continuity of the about group is broken, the <table> isn't recognized as being related to the <span typeof="mw:Object/Template">, and therefore the table and its contents aren't alienated (although the empty span is).
CCing original reporter from bug 43076 comment 1.
The metas are introduced by a DOM post-processor pass that tries to determine tags that were added/removed by the HTML tree builder and add placeholder metas to enable correct rting (to recover information from the HTML tree builder's correction). This pass does the fixup independent of whether the content came from top-level wikitext or template wikitext. Hence the placeholders in template content. That should be fixed, if possible. In addition, wonder if this is also some bug in some template expansion since I didn't see any excess </tr> tags in the template source (although I didn't look closely at all nested templates). In any case, independent of the above, we should revisit if we need to add fixup information (for rt-purposes) for </tr>, </td> and such tags that are subject to foster parenting. Assuming excess closing tr/td/th tags are erroneous in the first place, maybe not bother trying to rt those perfectly.
This should now be fixed by commit 8994ef5c (https://gerrit.wikimedia.org/r/#/c/63444/) which no longer adds these meta tags inside template content. Roan: can you verify this on your end?
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]