From 46f84b02845ab5d99a10bb920122df9663615f33 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 23 Dec 2016 17:18:30 +0100 Subject: [PATCH] [FIX] mail: linkify livechat message so frontend has them In ff56304f58c a solution was tried to have message posted from backend livechat linkified for visitor in frontend. This was forward-ported when it should not have been and introduced issues including: - `href="{link}"` would become `href="{link}"` - if html entities such as the ones for U+00A0, and entities <, >, ', " or ` were next to the link, the entity would be linkified too (up to the ;) This happen because utils.linkify function is to be used with text content and not html which was the case in this instance. opw-693457 opw-702410 --- addons/mail/static/src/js/chat_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index d2bfade1d38..f60e8c2eb3d 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -667,7 +667,7 @@ var chat_manager = { // to linkify the urls we end up with double linkification a bit everywhere. // Ideally we want to keep the content as text internally and only make html // enrichment at display time but the current design makes this quite hard to do. - var body = utils.linkify(_.str.trim(data.content)); + var body = utils.parse_and_transform(_.str.trim(data.content), utils.add_link); var msg = { partner_ids: data.partner_ids,