diff options
Diffstat (limited to 'addons/web_editor/static/src/js/summernote.js')
| -rw-r--r-- | addons/web_editor/static/src/js/summernote.js | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
