summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/xml/discuss.xml
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2020-01-08 09:54:37 +0000
committerAlexandre Kühn <aku@odoo.com>2020-01-08 14:08:14 +0000
commite4850c1bb579c440e4c6716b170a3ad4c33531e3 (patch)
treec3df951b83280998ed2dc23b2c8052bc62821614 /addons/mail/static/src/xml/discuss.xml
parent9b9710f61d173ef5376e2b52e458229559bde144 (diff)
[FIX] mail: faster opening of messaging menu
Before this commit, opening the messaging menu might be slow. This was caused by the parsing of bodies of messages with lots of HTML nodes. Indeed, the body of a message is linkified and inlined, and both processes were quite slow due to their implementation: each node in the HTML were recursively parsed and re-assigning `innerHTML`. As a result, each node was triggering an HTML parse, which is very slow on complex nodes. This commit fixes this performance issue by speeding up inlining and linkifying of html strings. In the case of linkify, it now triggers an HTML parse only when necessary, while inlining now relies on its textContent value. These changes should drastically improve the speed of opening and rendering messaging menu, almost ten times faster. Task-Id 2076299 closes odoo/odoo#42949 X-original-commit: 8db0afb50ce0853a6a8ab7ee11dd5ed876abab64 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/xml/discuss.xml')
-rw-r--r--addons/mail/static/src/xml/discuss.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/static/src/xml/discuss.xml b/addons/mail/static/src/xml/discuss.xml
index 3b21d7f230a..98788e303ff 100644
--- a/addons/mail/static/src/xml/discuss.xml
+++ b/addons/mail/static/src/xml/discuss.xml
@@ -341,7 +341,7 @@
<t t-elif="preview.author">
<t t-esc="preview.author"/>:
</t>
- <t t-raw="preview.body"/>
+ <t t-esc="preview.body"/>
</t>
</div>
<span title="Mark as Read" class="o_discuss_icon o_mail_preview_mark_as_read fa fa-check" t-if="preview.unreadCounter"/>