Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Improve room list message previews (#7224)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Nov 29, 2021
1 parent 87e8e3d commit 768e270
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stores/room-list/previews/MessageEventPreview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export class MessageEventPreview implements IPreview {
}

if (hasHtml) {
body = getHtmlText(body);
const sanitised = getHtmlText(body.replace(/<br\/?>/gi, "\n")); // replace line breaks before removing them
// run it through DOMParser to fixup encoded html entities
body = new DOMParser().parseFromString(sanitised, "text/html").documentElement.textContent;
}

body = sanitizeForTranslation(body);
Expand Down

0 comments on commit 768e270

Please sign in to comment.