fix orderedList truncated after the codeBlock is deleted in the orderedList

This commit is contained in:
wangxiang 2023-08-28 10:20:53 +08:00 committed by GitHub
parent 2a83166a46
commit 36a66600c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,6 +138,12 @@ export const CodeBlock = Node.create<CodeBlockOptions>({
}
if (isAtStart || !$anchor.parent.textContent.length) {
if (this.editor.isActive('orderedList'))
return this.editor
.chain()
.insertContent('<p></p>')
.deleteNode(this.name)
.run()
return this.editor.commands.clearNodes()
}