Page MenuHomePhabricator

Parsoid does not handle SOL correctly in native template expansion
Open, NormalPublic

Description

$ echo '{{1x|* Bar}}' | bin/parse.js --usephppreprocessor=true --normalize
<ul>
<li>Bar</li>
</ul>

vs

$ echo '{{1x|* Bar}}' | bin/parse.js --usephppreprocessor=false --normalize
<p>* Bar</p>

Template expansion ought to insert a newline before templates whose expansion text starts with * # : ; {| to match PHP behavior (T14974).

This isn't a problem in production, since we use the PHP preprocessor, which does do this insertion. However, it causes it us to fail various parser tests (which use Parsoid's native expansion). Might be worth fixing to improve our test coverage and reduce false failures.

Event Timeline

cscott created this task.May 3 2017, 3:29 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 3 2017, 3:29 PM
cscott added a comment.May 3 2017, 3:45 PM

Note also T64424: Get rid of native template expansion support being used for parser tests, T115395: Improve Parsoid's mock API, test the batch API client, and T115461: Testing: Verify mock API responses against mediawiki API responses. If we manage to ditch the native template expansion entirely, this issue goes away -- at the cost of making our parser tests even more dependent on having a running PHP wiki to run tests against.

Arlolra triaged this task as Normal priority.May 12 2017, 2:51 PM