summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-03-11 16:45:19 +0100
committerChristophe Matthieu <chm@odoo.com>2015-07-10 17:00:13 +0200
commitf17d6cb6d95a62ccdef81e83b4f9dcb18e12632c (patch)
tree805794153900834c3680f2f79b72c31327b8c2dc /addons/web_editor/static/src
parent77d848d4f5c378fd843b4eb6ac3f93a2497ea986 (diff)
[FIX] web_editor: summernote: don't create a p tag in empty o_editable if it's a style tag (eg: strong)
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/rte.summernote.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js
index 1086f4b369c..f6148e26bc3 100644
--- a/addons/web_editor/static/src/js/rte.summernote.js
+++ b/addons/web_editor/static/src/js/rte.summernote.js
@@ -427,7 +427,10 @@ var fn_visible = $.summernote.pluginEvents.visible;
$.summernote.pluginEvents.visible = function (event, editor, layoutInfo) {
var res = fn_visible.call(this, event, editor, layoutInfo);
var $node = $(dom.node(range.create().sc));
- if (($node.is('[data-oe-type="html"]') || $node.is('[data-oe-field="arch"]')) && $node.hasClass("o_editable") && !$node[0].children.length) {
+ if (($node.is('[data-oe-type="html"]') || $node.is('[data-oe-field="arch"]')) &&
+ $node.hasClass("o_editable") &&
+ !$node[0].children.length &&
+ "h1 h2 h3 h4 h5 h6 p b bold i u code sup strong small pre th td".toUpperCase().indexOf($node[0].nodeName) === -1) {
var p = $('<p><br/></p>')[0];
$node.append( p );
range.createFromNode(p.firstChild).select();