mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
Merge pull request #666 from vector-im/madlittlemods/explicit-domparser-document-for-consistent-return-with-linkedom-ssr
Fix missing reply text when message body is parsed as HTML in `linkedom` (SSR)
This commit is contained in:
commit
460780d602
@ -64,6 +64,6 @@ export function parseHTML(html) {
|
||||
// If DOMPurify uses DOMParser, can't we just get the built tree from it
|
||||
// instead of re-parsing?
|
||||
const sanitized = DOMPurify.sanitize(html, sanitizeConfig);
|
||||
const bodyNode = new DOMParser().parseFromString(sanitized, "text/html").body;
|
||||
const bodyNode = new DOMParser().parseFromString(`<!DOCTYPE html><html><body>${sanitized}</body></html>`, "text/html").body;
|
||||
return new HTMLParseResult(bodyNode);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user