[FIX] summernote: wrap the content with p when the user keyup on 'enter' but should not wrap the content if the editable area is a p, li or other para

This commit is contained in:
Christophe Matthieu
2015-03-23 12:25:06 +01:00
parent 421693d952
commit 2f5e4149fb
2 changed files with 6 additions and 1 deletions
@@ -474,6 +474,11 @@ define([
return this.normalize();
}
// if apply the editor to a P, LI...
if (dom.isText(sc) && /^P|^LI|^H[1-7]/.test(sc.parentNode.nodeName.toUpperCase())) {
return this.normalize();
}
// find inline top ancestor
var topAncestor;
if (dom.isInline(sc)) {
+1 -1
View File
@@ -1026,7 +1026,7 @@ define(['summernote/editing/Editor', 'summernote/summernote'], function (Editor)
var node = dom.node(r.sc);
var last = node;
while (node && dom.isSplitable(node) && !dom.isList(node)) {
while (node && dom.isSplitable(node) && !dom.isList(node) && !dom.isEditable(node)) {
last = node;
node = node.parentNode;
}