mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 09:25:29 +08:00
fix: remove node before hr if it’s an empty text block, fix #1665
This commit is contained in:
parent
9fc0ee9ea5
commit
4151e2fd81
@ -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
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user