https://bugzilla.wikimedia.org/show_bug.cgi?id=43155
Web browser: ---
Bug ID: 43155
Summary: Parsoid produces <meta>s for "</tr>" even in tables
generated by templates, breaking VE
Product: Parsoid
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: JS/General
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Mobile Platform: ---
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).
--
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l