fix: fix a bug when insert newline at node start, fix #1411
This commit is contained in:
@@ -118,7 +118,7 @@ export const splitBlock: RawCommands['splitBlock'] = ({ keepMarks = true } = {})
|
||||
const first = tr.mapping.map($from.before())
|
||||
const $first = tr.doc.resolve(first)
|
||||
|
||||
if ($from.parent.canReplaceWith($first.index(), $first.index() + 1, deflt)) {
|
||||
if ($from.node(-1).canReplaceWith($first.index(), $first.index() + 1, deflt)) {
|
||||
tr.setNodeMarkup(tr.mapping.map($from.before()), deflt)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user