[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:
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user