From f8ce8942f5b334e982f4919a6b61638d381f9ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20K=C3=BChn?= Date: Mon, 6 Dec 2021 12:25:00 +0100 Subject: [PATCH] refactor: simplify unsetAllMarks --- packages/core/src/commands/unsetAllMarks.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/core/src/commands/unsetAllMarks.ts b/packages/core/src/commands/unsetAllMarks.ts index 7742af63c..9d17202f5 100644 --- a/packages/core/src/commands/unsetAllMarks.ts +++ b/packages/core/src/commands/unsetAllMarks.ts @@ -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