summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/summernote.js
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2015-12-01 10:30:44 +0100
committerMartin Trigaux <mat@odoo.com>2015-12-01 10:30:44 +0100
commit90254beedbb6a9bdf055ae582af866073eab4f2c (patch)
tree8477905dd0a6586dedab562274247604ecc479a3 /addons/web_editor/static/src/js/summernote.js
parent2f6feef3a3dcd39ce2ca1fbcfa21616e02d1ab6d (diff)
parent00ee6e7ba4e68cfef0b26f9d02f9584b8c972291 (diff)
[MERGE] forward port of branch 9.0 up to 00ee6e7b
Diffstat (limited to 'addons/web_editor/static/src/js/summernote.js')
-rw-r--r--addons/web_editor/static/src/js/summernote.js6
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