Page MenuHomePhabricator

Unnecessary nowiki'ing of bare table rows
Closed, ResolvedPublic

Description

In https://gerrit.wikimedia.org/r/#/c/227481/2/tests/parserTests-blacklist.js, @ssastry asks if the <nowiki>s are required for the table rows in,

<nowiki> </nowiki><nowiki>||</nowiki> <nowiki>||</nowiki>
<table>
<tr><td> a
</table>

Nope! This is bug.

In WEHP.escapedText, we use the tokenizer on text to determine what needs escaping. The idea being that if it tokenizes as a construct, it needs escaping. This works great except for the cases where we rely on the token stream patcher to convert tokens back to strings if they aren't in the right context (like table rows outside of tables).

The TokenStreamPatcher is a sync transformation, maybe just apply it to our token array here.

Event Timeline

Arlolra raised the priority of this task from to Medium.
Arlolra updated the task description. (Show Details)
Arlolra added a project: Parsoid.
Arlolra added subscribers: Arlolra, ssastry.
ssastry claimed this task.
subbu@earth:~/work/wmf/parsoid] cat /tmp/wt
 || ||
<table>
<tr><td> a
</table>
[subbu@earth:~/work/wmf/parsoid] php bin/parse.php --wt2wt < /tmp/wt
 || ||
<table>
<tr><td> a
</table>