Page MenuHomePhabricator

StructuredDiscussions has broken DOM transformations
Open, Needs TriagePublicBUG REPORT

Description

includes/Conversion/Utils.php does several HTML transformations. It makes these using DOMDocument and uses saveXML and/or saveHTML.

Both of these have problems with preserving the HTML document correctly. See also: T217766 and T252038

Probably these issues should be worked around by making use of RemexHtml or another replacement for the document transformations, like Core's HtmlFormatter.

Event Timeline

Sorry, but I don't know what you're referring to. In which repository is the file includes/Conversion/Utils.php? I'm not sure if you meant to tag this with DiscussionTools

I guess it's about Flow? (unwisely and incompletely renamed to StructuredDiscussions).

By the way, we do use RemexHtml (via Parsoid) for code that parses and serializes HTML in DiscussionTools: https://github.com/wikimedia/mediawiki-extensions-DiscussionTools/blob/26b69d2c706e69df78ab00c27a98c69d5e3b5d9a/includes/ApiDiscussionToolsEdit.php#L57-L62. Maybe you can borrow that approach for Flow.

TheDJ renamed this task from DiscussionTools has broken DOM transformations to StructuredDiscussions has broken DOM transformations.Oct 21 2021, 12:32 PM
TheDJ edited projects, added StructuredDiscussions; removed DiscussionTools.
TheDJ updated the task description. (Show Details)

@matmarex even I get this stuff confused these days ;)

kostajh subscribed.

Thanks for filing. Given our team's backlog and priorities, I don't think we will be able to work on this any time soon, but if a patch is submitted we could make time for review.