Page MenuHomePhabricator

Parsoid's TOC handling needs to deal with HTML-returning components (exts, SPTs, parser funcs returning HTML) consistently
Open, MediumPublic

Description

From T355092#9483046, Parsoid needs to handle sections defined in HTML-returning components (ex: special page transclusions, parser functions returning html) just like it deals with extensions. T355092 only dealt with extensions.

This is an edge case, but needs to be handled.

Related Objects

StatusSubtypeAssignedTask
OpenReleaseNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenFeatureNone
OpenNone
OpenNone
Resolvedcscott
Resolvedcscott
OpenNone
StalledNone
OpenNone
OpenNone
OpenBUG REPORTNone
OpenNone
OpenNone
OpenNone
Opencscott

Event Timeline

In T387582, @ihurbain raises that maybe we can have a broader discussion about what belongs in the TOC from transcluded content, rather than just mimicking the limitations of the legacy parser

Usually we do "strip kill markers" in the legacy parser, which just removes non-wikitext content entirely.

MSantos raised the priority of this task from Low to Medium.

A quick test seems to indicate that both Parsoid and the legacy parser use the .textContent of the HTML included in the heading to generate the TOC text (and presumably ID): https://en.wikipedia.org/w/index.php?title=User_talk:Cscott/Toc&oldid=1356567473

Special page transclusions can generate headings which the legacy Parser doesn't include in the TOC, which means it doesn't generate section edit links, div wrappers, etc.

One example:
https://igl.wikipedia.org/w/index.php?title=Wikip%C3%ADdiya:Uch%E1%BB%8Dl%E1%BB%8D_Wikimwdia_%E1%BB%8Djane_ileyi_chakadu