diff options
| author | Christophe Matthieu <chm@odoo.com> | 2016-01-14 15:21:39 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2016-01-14 15:21:39 +0100 |
| commit | 6e1ed6c8bbce29e9cb23e14eab47fe3d1d09c3c9 (patch) | |
| tree | ba93e07004e4adde0872c77a762b3674901e0820 | |
| parent | aad21cd5554ea310dd93bdadecaaf709c730b38e (diff) | |
[FIX] web_editor: paste simple text must wrap first line by p and remove unless font
| -rw-r--r-- | addons/web_editor/static/lib/summernote/src/js/module/Clipboard.js | 7 |
1 files changed, 5 insertions, 2 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 26b4ea86e46..1d5a99b31f5 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 @@ -144,9 +144,9 @@ define([ filter_tag($node.find('*'), $editable).removeAttr('title', 'alt', 'id', 'contenteditable'); /* - remove unless span + remove unless span and unwant font */ - $node.find('span:not([class]):not([style])').each(function () { + $node.find('span, font').filter(':not([class]):not([style])').each(function () { $(this).replaceWith($(this).contents()); }); $node.find('span + span').each(function () { @@ -169,6 +169,9 @@ define([ } else if (/h[0-9]+|li|table|p/i.test(this.tagName)) { $last = $('<p/>'); $arch.append(this).append($last); + } else if ($arch.is(':empty') && dom.isText(this)) { + $last = $('<p/>').append(this); + $arch.append($last); } else if (this.nodeType !== Node.COMMENT_NODE) { $last.append(this); } |
