fix: remove node before hr if it’s an empty text block, fix #1665
This commit is contained in:
@@ -55,9 +55,11 @@ export const HorizontalRule = Node.create<HorizontalRuleOptions>({
|
|||||||
return true
|
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
|
return true
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user