From 1505fee0e3d2460d062281100d306c279c144236 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Wed, 22 Mar 2017 13:12:33 +0100 Subject: [FIX] web_editor: properly transcode `fa` alias icons When adding a font-awesome icon to a mail template, the icon is converted to an image once the template is saved. To do that, the code checks all the `.fa-XXX` definitions in the stylesheets to know which content the image have to use. The problem is that this was not considering the font-awesome aliases. Indeed, the `fa-facebook-f` icon was able to be used while its alias `fa-facebook` was not working. --- addons/web_editor/static/src/js/transcoder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/js/transcoder.js') diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js index 306369cddfa..ca6f751f954 100644 --- a/addons/web_editor/static/src/js/transcoder.js +++ b/addons/web_editor/static/src/js/transcoder.js @@ -132,7 +132,7 @@ var font_to_img = function ($editable) { var icon, content; _.find(widget.fontIcons, function (font) { return _.find(widget.getCssSelectors(font.parser), function (css) { - if ($font.is(css[0].replace(/::?before$/, ''))) { + if ($font.is(css[0].replace(/::?before/g, ''))) { icon = css[2].split("-").shift(); content = css[1].match(/content:\s*['"]?(.)['"]?/)[1]; return true; -- cgit v1.2.3