Page MenuHomePhabricator

Better handle `__TOC__` in parser tests
Closed, ResolvedPublic

Description

Since the Parsoid DOM doesn't include TOC information, by design, we should go through all the parser tests which mention __TOC__ and make them Parsoid-compatible. Either (1) making them PHP-only, or (2) adding trivial html/parsoid clauses, self-documenting that Parsoid doesn't emit TOC info, or (3) adding some sort of "TOC normalization" to our normalization utility, to remove TOC markup.

(Note that there's also an issue with empty <p></p> being generated by the PHP TOC, see T92892, which might complicate option 3.)

Event Timeline

cscott raised the priority of this task from to Needs Triage.
cscott updated the task description. (Show Details)
cscott added a project: Parsoid.
cscott subscribed.
Arlolra triaged this task as Medium priority.Mar 17 2015, 8:05 PM
Arlolra subscribed.

Given the intent to implement TOC in Parsoid (T270199), probably the correct thing to do is add a 'toc' flag to the !!options to opt-in to the toc post-processing step (when that gets implemented).

ssastry reopened this task as Open.
ssastry claimed this task.

Change 903797 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/services/parsoid@master] Add synthetic TOC if necessary

https://gerrit.wikimedia.org/r/903797

Change 903797 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Add synthetic TOC if necessary

https://gerrit.wikimedia.org/r/903797

Change 914008 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-a7

https://gerrit.wikimedia.org/r/914008

Change 914008 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.18.0-a7

https://gerrit.wikimedia.org/r/914008