From aae3072209abe796c214c9aa6a6bc07a110fe4b0 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 14 Feb 2023 14:07:38 +0100 Subject: [PATCH] Prepare cleanHtml() for new feature --- dev/Common/UtilsUser.js | 2 +- dev/Model/Message.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/Common/UtilsUser.js b/dev/Common/UtilsUser.js index 6f5176d97..1621f1b8b 100644 --- a/dev/Common/UtilsUser.js +++ b/dev/Common/UtilsUser.js @@ -276,7 +276,7 @@ populateMessageBody = (oMessage, popup) => { MessageUserStore.error(''); const messagesDom = MessageUserStore.bodiesDom(); if (messagesDom) { - let id = 'rl-msg-' + oMessage.hash.replace(/[^a-zA-Z0-9]/g, ''), + let id = 'rl-msg-' + oMessage.hash, body = elementById(id); if (body) { oMessage.body = body; diff --git a/dev/Model/Message.js b/dev/Model/Message.js index e19415c04..b45a66fde 100644 --- a/dev/Model/Message.js +++ b/dev/Model/Message.js @@ -25,6 +25,8 @@ import { LanguageStore } from 'Stores/Language'; import Remote from 'Remote/User/Fetch'; const + msgHtml = msg => cleanHtml(msg.html(), msg.attachments()), + toggleTag = (message, keyword) => { const lower = keyword.toLowerCase(), flags = message.flags, @@ -291,7 +293,7 @@ export class MessageModel extends AbstractModel { viewHtml() { const body = this.body; if (body && this.html()) { - let result = cleanHtml(this.html(), this.attachments()); + let result = msgHtml(this); this.hasExternals(result.hasExternals); this.hasImages(body.rlHasImages = !!result.hasExternals); @@ -460,7 +462,7 @@ export class MessageModel extends AbstractModel { ); return clone.innerHTML; } - let result = cleanHtml(this.html(), this.attachments()) + let result = msgHtml(this); return result.html || plainToHtml(this.plain()); }