It should use Remex instead. PHP's loadHTML has all sorts of crazy bugs and corner cases; nothing else in core uses it.
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?