fix(): 在列表处插入卡片

This commit is contained in:
yanmao 2021-11-05 21:49:15 +08:00
parent ed3c40a6a3
commit 849a04b7dc
1 changed files with 10 additions and 0 deletions

View File

@ -548,6 +548,16 @@ class Block implements BlockModelInterface {
if (!range) change.apply(safeRange);
return;
}
if (
node.isList(safeRange.startNode) ||
safeRange.startNode.closest('li').length > 0
) {
const fragment = doc.createDocumentFragment();
fragment.appendChild(block[0]);
list.insert(fragment, range);
if (!range) change.apply(safeRange);
return;
}
// <p><cursor /><br /></p>
// to
// <p><br /><cursor /></p>