From a53b468201a72d6e8d1681ebb85201a311231ed2 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Tue, 31 May 2022 12:06:43 +0000 Subject: [PATCH] [FIX] web_editor: remove style of a link Before this commit When removing the style of a link in an html_field, the style was not removed. After this commit When removing the style of a link in an html_field, the style is removed. task-2857072 closes odoo/odoo#92573 X-original-commit: f98c6b1ffe3a788f2da6536a109efe68cb6c2da7 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/widgets/link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js index 1147e28bb60..4f3895341d1 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js @@ -198,7 +198,7 @@ const Link = Widget.extend({ href: data.url, target: data.isNewWindow ? '_blank' : '', }); - if (data.classes) { + if (typeof data.classes === "string") { data.classes = data.classes.replace(/o_default_snippet_text/, ''); attrs.class = `${data.classes}`; }