Skip to content

Commit

Permalink
fix: fix a bug when insert newline at node start, fix #1411
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Jun 7, 2021
1 parent cc69609 commit b97bebe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/commands/splitBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit b97bebe

Please sign in to comment.