Page MenuHomePhabricator

Improve parser tests normalization.
Open, MediumPublic

Description

We fail a number of tests due to different newlines around end tags. For example, in the "Paragraphs with newline spacing with non-empty white-space lines in between" testcase, the expected output begins:

<hr />
<p>a
</p><p>b
</p>
<hr />

while Parsoid emits:

<hr/>
<p>a</p>
<p>b</p><hr/>

We should (carefully) normalize trailing whitespace and inter-element whitespace (IEW) to make these tests pass (without obscuring real whitespace issues).

Bug 55588 is related, it deals with the IEW issue. But there is also trailing whitespace to consider.

Simply normalizing \n</p> <-> </p>\n might be a good start.

You can see a lot of these issues by running parserTests.js --update-tests and then using git diff to see the changes made.


Version: unspecified
Severity: normal

Details

Reference
bz63195

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:52 AM
bzimport added a project: Parsoid-Tests.
bzimport set Reference to bz63195.
Aklapper subscribed.

@cscott: Hi, I'm resetting the task assignee due to inactivity. Please feel free to reclaim this task if you plan to work on this - it would be welcome! Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for more information - thanks!