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