mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-10 19:23:49 +08:00
refactor: simplify unsetAllMarks
This commit is contained in:
parent
8d7c4e78e7
commit
f8ce8942f5
@ -20,12 +20,8 @@ export const unsetAllMarks: RawCommands['unsetAllMarks'] = () => ({ tr, state, d
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dispatch) {
|
if (dispatch) {
|
||||||
Object
|
|
||||||
.entries(state.schema.marks)
|
|
||||||
.forEach(([, mark]) => {
|
|
||||||
ranges.forEach(range => {
|
ranges.forEach(range => {
|
||||||
tr.removeMark(range.$from.pos, range.$to.pos, mark as any)
|
tr.removeMark(range.$from.pos, range.$to.pos)
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user