Page MenuHomePhabricator

Modules that inspect wikitext might run into opaque Parsoid fragment markers
Open, Needs TriagePublic

Description

See this discussion thread.

But, TLDR is that ru:Модуль:Вложенный список#L-363 looks for heading wikitext and instead encounters {{#parsoid\u0000fragment:0}} markers inserted by Parsoid. This might have been the end result of https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1304193 but independent of what patch caused it, at one level, this is not very different from modules encountering strip markers inserted by the legacy parser, except Parsoid's fragment markers are opaque. This is somewhat by design, but we should look into what functionality / API interface module authors need that we can provide that is not tied to specific implementation details and lets us evolve Parsoid a bit more freely (while being aware that https://www.hyrumslaw.com/ is a real thing).

Event Timeline

It's possible that we could support the horrible enwiktionary hacks, now that we are also putting heading information into strip markers...

FWIW previously headings from the old parser also generated strip markers, which were inside the heading text itself. This reminded me that https://ru.wikipedia.org/wiki/Модуль:RedirectChecker (admittedly an even hackier module! tracks whether section redirects lead to nowhere and adds an error category / displays an error message) would probably also have some issues going forward since it might no longer be able to look up the heading itself in the retrieved code (though so far I haven't heard any complaints about it).

Happy to report that actually, the issue was that although #parsoidfragment was something that was displayed in the page output while I was trying to troubleshoot it, on the wikitext level they were strip markers, like UNIQ--h-20--QINU (and it seems like their removal basically resolves the issue): https://ru.wikipedia.org/wiki/Модуль:Вложенный_список#L-366
I wish it was possible to know what level the heading is based on that marker, though. But being able to test it via TemplateSandbox really helped here anyway, thank you.