Skip to content

Commit

Permalink
Merge pull request #666 from vector-im/madlittlemods/explicit-dompars…
Browse files Browse the repository at this point in the history
…er-document-for-consistent-return-with-linkedom-ssr

Fix missing reply text when message body is parsed as HTML in `linkedom` (SSR)
  • Loading branch information
bwindels authored Feb 14, 2022
2 parents 75e2618 + dfed041 commit 460780d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/platform/web/parsehtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 460780d

Please sign in to comment.