forked from mystiq/hydrogen-web
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
1 changed files with 1 additions and 1 deletions
|
@ -64,6 +64,6 @@ export function parseHTML(html) {
|
||||||
// If DOMPurify uses DOMParser, can't we just get the built tree from it
|
// If DOMPurify uses DOMParser, can't we just get the built tree from it
|
||||||
// instead of re-parsing?
|
// instead of re-parsing?
|
||||||
const sanitized = DOMPurify.sanitize(html, sanitizeConfig);
|
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);
|
return new HTMLParseResult(bodyNode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue