Page MenuHomePhabricator

Lost attribute (and dirty diff wt2wt) in a table cell
Closed, ResolvedPublic

Description

[subbu@earth:~/work/wmf/parsoid] cat /tmp/wt
{|
| rowspan=3 text align=center {{Party shading/Republican}}| [[Republican Party (United States)|Republican]]<br>(cast by Democratic electors)
|}
[subbu@earth:~/work/wmf/parsoid] parse.js --normalize=parsoid < /tmp/wt

<table>
<tbody>
<tr>
<td rowspan="3" typeof="mw:ExpandedAttrs" data-mw='{"attribs":[[{"txt":"style","html":"&lt;span typeof=\"mw:Transclusion\" data-mw=&apos;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"Party shading/Republican\",\"href\":\"./Template:Party_shading/Republican\"},\"params\":{},\"i\":0}}]}&apos;>style=\"background:#FFB6B6\"&lt;/span>"},{"html":""}]]}'><a rel="mw:WikiLink" href="./Republican_Party_(United_States)" title="Republican Party (United States)">Republican</a><br/>(cast by Democratic electors)</td>
</tr>
</tbody>
</table>

[subbu@earth:~/work/wmf/parsoid] parse.js --wt2wt < /tmp/wt
{|
| rowspan="3" {{Party shading/Republican}} text |[[Republican Party (United States)|Republican]]<br>(cast by Democratic electors)
|}

In the parse output, the align=center attribute is missing which causes it to disappear in wt2wt. Additionally and more minorly, the text attribute is reordered in wt2wt output

Event Timeline

ssastry triaged this task as Medium priority.May 14 2018, 2:23 PM
ssastry moved this task from Needs Triage to Read Views on the Parsoid board.

Change 435064 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] Fix off by one in attribute expander

https://gerrit.wikimedia.org/r/435064

Change 435064 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Fix off by one in attribute expander

https://gerrit.wikimedia.org/r/435064