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.