From a3d7c3ad8b457397869ef3548a8444db895b0d65 Mon Sep 17 00:00:00 2001 From: winetree94 Date: Thu, 21 Dec 2023 17:56:27 +0900 Subject: [PATCH] e --- packages/core/src/commands/toggle-mark-with-attrs.ts | 3 +-- packages/core/src/plugins/keymap.ts | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/src/commands/toggle-mark-with-attrs.ts b/packages/core/src/commands/toggle-mark-with-attrs.ts index 577a8447..a816d183 100644 --- a/packages/core/src/commands/toggle-mark-with-attrs.ts +++ b/packages/core/src/commands/toggle-mark-with-attrs.ts @@ -52,7 +52,7 @@ export const toggleMarkWithAttrs = ( if (missing) { return false; } - console.log(node); + missing = !( markType.isInSet(node.marks) && @@ -74,7 +74,6 @@ export const toggleMarkWithAttrs = ( ); return undefined; }); - console.log(missing); return !missing; }); } diff --git a/packages/core/src/plugins/keymap.ts b/packages/core/src/plugins/keymap.ts index ed8dfaca..e61f73e7 100644 --- a/packages/core/src/plugins/keymap.ts +++ b/packages/core/src/plugins/keymap.ts @@ -1,6 +1,7 @@ import { keymap } from 'prosemirror-keymap'; import { baseKeymap } from 'prosemirror-commands'; import { Plugin } from 'prosemirror-state'; +import { clearMarks } from '../commands'; export const edimBasicKeymapPlugins = (): Plugin[] => { return [ @@ -55,6 +56,10 @@ export const edimBasicKeymapPlugins = (): Plugin[] => { return true; }, + 'Mod-\\': (state, dispatch) => { + clearMarks()(state, dispatch); + return true; + }, }), keymap(baseKeymap), ];