From 1a1cb3d60be4f042b523fd3dd2fc54c67afff1c9 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 5 Apr 2025 22:30:47 +0300 Subject: [PATCH] feat(editor): rewrite to --- packages/ckeditor5-build-trilium/src/config.ts | 2 ++ .../src/strikethrough_as_del.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 packages/ckeditor5-build-trilium/src/strikethrough_as_del.ts diff --git a/packages/ckeditor5-build-trilium/src/config.ts b/packages/ckeditor5-build-trilium/src/config.ts index a6a90a802..f385f81f6 100644 --- a/packages/ckeditor5-build-trilium/src/config.ts +++ b/packages/ckeditor5-build-trilium/src/config.ts @@ -78,6 +78,7 @@ import '../../ckeditor5-footnotes/src/footnote.css'; import { Footnotes } from '../../ckeditor5-footnotes'; import Kbd from "../../ckeditor5-keyboard-marker/src/Kbd"; import { Admonition } from "../../ckeditor5-admonition"; +import StrikethroughAsDel from './strikethrough_as_del'; export const COMMON_PLUGINS = [ // essentials package expanded to allow selectively disable Enter and ShiftEnter @@ -136,6 +137,7 @@ export const COMMON_PLUGINS = [ Mention, InternalLinkPlugin, ItalicAsEmPlugin, + StrikethroughAsDel, MarkdownImportPlugin, CuttonotePlugin, MentionCustomization, diff --git a/packages/ckeditor5-build-trilium/src/strikethrough_as_del.ts b/packages/ckeditor5-build-trilium/src/strikethrough_as_del.ts new file mode 100644 index 000000000..08f00cfc7 --- /dev/null +++ b/packages/ckeditor5-build-trilium/src/strikethrough_as_del.ts @@ -0,0 +1,15 @@ +import Plugin from '@ckeditor/ckeditor5-core/src/plugin'; + +export default class StrikethroughAsDel extends Plugin { + + init() { + this.editor.conversion + .for("downcast") + .attributeToElement({ + model: "strikethrough", + view: "del", + converterPriority: "high" + }); + } + +}