mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 01:12:56 +08:00
refactor: simplify unsetAllMarks
This commit is contained in:
parent
8d7c4e78e7
commit
f8ce8942f5
@ -20,13 +20,9 @@ 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)
|
||||
})
|
||||
})
|
||||
ranges.forEach(range => {
|
||||
tr.removeMark(range.$from.pos, range.$to.pos)
|
||||
})
|
||||
}
|
||||
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user