mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Improve room list message previews (#7224)
This commit is contained in:
parent
87e8e3d6ef
commit
768e270f3f
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue