Page MenuHomePhabricator

Consider whether Parsoid will support forced linear parsing.
Open, Needs TriagePublic

Description

Some extensions, in particular Variables, Arrays and Loops, may inherently depend on linear parsing to produce valid output. This is ususally not visible from hook usage, but becomes apparent from setting attributes to the parser or using ParserOutput->setExtensionData .

At some point, a decision needs to be made if there should be continued support for linear parsing in some low-performance mode, or whether this will break entirely sooner or later.

Event Timeline

I was chatting about this in the MediaWiki Discord server with another user by the name of "skizzerz", and they had an interesting idea: what about implementing the legacy parser as a content model? That would allow wikis to use one or the other on a per-namespace and even per-page basis, as needed, potentially even mixing and matching if transclusions can be handled correctly between the two. The legacy parser could be defined as always being linear, while Parsoid would not. That doesn't solve the underlying issue of allowing Variables (et al) to work with Parsoid, but it does, at least, provide a method for wikis to move forward with either or both of the legacy parser and Parsoid, potentially moving over gradually as time and resources permit. I've never looked at content handlers at anything but a surface level myself, so I don't know if this is actually a viable solution, but it seems like it might be a good way forward if it can be made to work without too much effort.