summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/backend/convert_inline.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor/static/src/js/backend/convert_inline.js')
-rw-r--r--addons/web_editor/static/src/js/backend/convert_inline.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/backend/convert_inline.js b/addons/web_editor/static/src/js/backend/convert_inline.js
index 8f8daab67c7..13c7c68128b 100644
--- a/addons/web_editor/static/src/js/backend/convert_inline.js
+++ b/addons/web_editor/static/src/js/backend/convert_inline.js
@@ -422,6 +422,16 @@ FieldHtml.include({
attachmentThumbnailToLinkImg($editable);
fontToImg($editable);
classToStyle($editable);
+
+ // fix outlook image rendering bug
+ _.each(['width', 'height'], function(attribute) {
+ $editable.find('img[style*="width"], img[style*="height"]').attr(attribute, function(){
+ return $(this)[attribute]();
+ }).css(attribute, function(){
+ return $(this).get(0).style[attribute] || 'auto';
+ });
+ });
+
this.wysiwyg.setValue($editable.html(), {
notifyChange: false,
});
@@ -439,6 +449,10 @@ FieldHtml.include({
styleToClass($editable);
imgToFont($editable);
linkImgToAttachmentThumbnail($editable);
+
+ // fix outlook image rendering bug
+ $editable.find('img[style*="width"], img[style*="height"]').removeAttr('height width');
+
this.wysiwyg.setValue($editable.html(), {
notifyChange: false,
});