fix: remove node before hr if it’s an empty text block, fix #1665

This commit is contained in:
Philipp Kühn 2021-09-29 23:56:43 +02:00
parent 9fc0ee9ea5
commit 4151e2fd81

View File

@ -55,9 +55,11 @@ export const HorizontalRule = Node.create<HorizontalRuleOptions>({
return true
}
const posBefore = $anchor.before()
const from = $anchor.before()
const to = $anchor.start()
tr.deleteRange(posBefore, posBefore + 1)
tr.deleteRange(from, to)
tr.setSelection(TextSelection.create(tr.doc, from))
return true
})