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

Improve room list message previews #7224

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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