Page MenuHomePhabricator

Parsoid does not handle SOL correctly in native template expansion
Closed, DuplicatePublic


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


$ 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 Medium priority.May 12 2017, 2:51 PM
LGoto moved this task from Needs Triage to Backlog on the Parsoid board.Feb 15 2020, 9:42 PM
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptFeb 15 2020, 9:42 PM
Restricted Application removed a subscriber: Liuxinyu970226. · View Herald TranscriptJun 9 2020, 10:58 PM