refactor: simplify unsetAllMarks
This commit is contained in:
@@ -20,12 +20,8 @@ export const unsetAllMarks: RawCommands['unsetAllMarks'] = () => ({ tr, state, d
|
||||
}
|
||||
|
||||
if (dispatch) {
|
||||
Object
|
||||
.entries(state.schema.marks)
|
||||
.forEach(([, mark]) => {
|
||||
ranges.forEach(range => {
|
||||
tr.removeMark(range.$from.pos, range.$to.pos, mark as any)
|
||||
})
|
||||
tr.removeMark(range.$from.pos, range.$to.pos)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user