From c82fce08c6a00c4c78cabb8b1f46708c2f4341fe Mon Sep 17 00:00:00 2001 From: sibiraj-s Date: Fri, 9 Jul 2021 00:28:15 +0530 Subject: [PATCH] fix: set correct underline shortcut --- projects/ngx-editor/schema/marks.ts | 5 ++++- projects/ngx-editor/src/lib/defaultPlugins.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/ngx-editor/schema/marks.ts b/projects/ngx-editor/schema/marks.ts index 4011313d..fc7d95ed 100644 --- a/projects/ngx-editor/schema/marks.ts +++ b/projects/ngx-editor/schema/marks.ts @@ -81,7 +81,10 @@ const code: MarkSpec = { const u: MarkSpec = { parseDOM: [ { tag: 'u' }, - { style: 'text-decoration=underline' } + { + style: 'text-decoration=underline', + consuming: false + } ], toDOM(): DOMOutputSpec { return ['u', 0]; diff --git a/projects/ngx-editor/src/lib/defaultPlugins.ts b/projects/ngx-editor/src/lib/defaultPlugins.ts index 428d8067..2053e5ab 100644 --- a/projects/ngx-editor/src/lib/defaultPlugins.ts +++ b/projects/ngx-editor/src/lib/defaultPlugins.ts @@ -115,6 +115,7 @@ const getKeyboardShortcuts = (schema: Schema, options: ShortcutOptions) => { keymap({ 'Mod-b': toggleMark(schema.marks.strong), 'Mod-i': toggleMark(schema.marks.em), + 'Mod-u': toggleMark(schema.marks.u), 'Mod-`': toggleMark(schema.marks.code), }), keymap({