Last modified: 2013-07-04 10:35:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45155, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43155 - Parsoid produces <meta>s for "</tr>" even in tables generated by templates, breaking VE
Parsoid produces <meta>s for "</tr>" even in tables generated by templates, b...
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Gabriel Wicke
:
Depends on: 48231
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-15 08:29 UTC by Roan Kattouw
Modified: 2013-07-04 10:35 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2012-12-15 08:29:15 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="{&quot;startTagSrc&quot;:&quot;|-&quot;,&quot;dsr&quot;:[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="{&quot;src&quot;:&quot;&lt;/tr&gt;&quot;}" />
<tr data-parsoid="{&quot;stx&quot;:&quot;html&quot;}">
[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).
Comment 1 Roan Kattouw 2012-12-15 08:35:35 UTC
CCing original reporter from bug 43076 comment 1.
Comment 2 ssastry 2012-12-15 17:40:35 UTC
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.
Comment 3 ssastry 2013-05-17 18:10:53 UTC
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?
Comment 4 Andre Klapper 2013-07-04 10:35:16 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links