feat(editor): rewrite <s> to <del>

This commit is contained in:
Elian Doran 2025-04-05 22:30:47 +03:00
parent fceee44844
commit 1a1cb3d60b
2 changed files with 17 additions and 0 deletions

View File

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

View File

@ -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"
});
}
}