refactor: simplify unsetAllMarks

This commit is contained in:
Philipp Kühn
2021-12-06 12:25:00 +01:00
parent 8d7c4e78e7
commit f8ce8942f5

View File

@@ -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