diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-10-17 15:14:47 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-10-17 15:14:47 +0200 |
| commit | 868e718e09e03dcc09b992f02ffee6feee7a026c (patch) | |
| tree | 692bd428409d83bd881fe4f757c67c40fbbccea3 /addons/web_editor/static/lib | |
| parent | 3993528bacf2231010ab65fef70dd17f93b26466 (diff) | |
| parent | 8d0942380b5743145bee624411a15d71d225b246 (diff) | |
[MERGE] forward port branch saas-15 up to 8d0942380b5
Diffstat (limited to 'addons/web_editor/static/lib')
| -rw-r--r-- | addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js b/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js index 8b42726ff7a..955b49437a8 100644 --- a/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js +++ b/addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js @@ -206,6 +206,18 @@ define([ r.select(); } + // If only pasting a <p/> element in an unique <p/> element, only paste + // the <p/> element text + var $p = $arch.children('p'); + var onlyAP = ($p.length === 1 && $arch.children().length === 1); + if (onlyAP) { + var $p1 = $(r.sc).closest('p'); + var $p2 = $(r.ec).closest('p'); + if ($p1.length && $p2.length && $p1[0] === $p2[0]) { + $arch.html($p.text()); + } + } + /* insert content */ |
