It should use Remex instead. PHP's loadHTML has all sorts of crazy bugs and corner cases; nothing else in core uses it.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
VueComponentParser: Use RemexHtml instead of PHP's HTML parser | mediawiki/core | master | +343 -118 | |
WIP: don't use loadHTML, it is evil. | mediawiki/core | master | +1 -0 |
Related Objects
Event Timeline
Change 605964 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] WIP: don't use loadHTML, it is evil.
Change 598133 had a related patch set uploaded (by Krinkle; owner: Catrope):
[mediawiki/core@master] VueComponentParser: Use RemexHtml instead of PHP's HTML parser
Change 605964 abandoned by Krinkle:
WIP: don't use loadHTML, it is evil.
Reason:
Superseded
Change 598133 merged by jenkins-bot:
[mediawiki/core@master] VueComponentParser: Use RemexHtml instead of PHP's HTML parser
Ah, I just noted on T253334 - I don't think RemexHtml is the right solution either - Vue templates also are not really html, as they include "elements" not in the HTML standard, and parsers may not handle them correctly. I ran into this just now using wmf/1.35.0-wmf.38 which has the RemexHtml parser, where I have an html table that has some of its rows provided by another Vue component:
<table><tbody> <tr><th>header...</th></tr> <internal-tr-component ...></internal-tr-component> </tbody></table> The parser is pulling the "internal-tr-component" outside of the table, which disrupts the display, and also confuses the validation as it thinks the template has 2 child nodes (I had to add an outer <div> to prevent the "<template> tag may not have multiple child tags" error). I think they need to be treated as straight XML, not HTML?See response in T253334. (Let's have this discussion over there, instead of in two places at once.)