diff options
| author | Martin Trigaux <mat@odoo.com> | 2015-12-01 10:30:44 +0100 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2015-12-01 10:30:44 +0100 |
| commit | 90254beedbb6a9bdf055ae582af866073eab4f2c (patch) | |
| tree | 8477905dd0a6586dedab562274247604ecc479a3 /addons/web_editor/static/src | |
| parent | 2f6feef3a3dcd39ce2ca1fbcfa21616e02d1ab6d (diff) | |
| parent | 00ee6e7ba4e68cfef0b26f9d02f9584b8c972291 (diff) | |
[MERGE] forward port of branch 9.0 up to 00ee6e7b
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/backend.js | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/summernote.js | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index e7c6d93853d..2c7c86466c1 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -122,8 +122,8 @@ var FieldTextHtmlSimple = widget.extend({ if (this.options['style-inline']) { transcoder.class_to_style(this.$content); transcoder.font_to_img(this.$content); - this.internal_set_value(this.$content.html()); } + this.internal_set_value(this.$content.html()); }, destroy_content: function () { $(".oe-view-manager-content").off("scroll"); diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index c5a9b3ebbef..ff509800c50 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -2320,6 +2320,12 @@ function summernote_paste (event) { var html = clipboardData.getData("text/html"); var $node = $('<div/>').html(html); + // if copying source did not provide html, default to plain text + if(!html) { + $node.text(clipboardData.getData("text/plain")).html(function(_, html){ + return html.replace(/\r?\n/g,'<br>'); + }); + } /* remove undesirable tag |
