From 9f6e03fd80f49e48dc9cc5be64622ba03324f910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 4 May 2026 16:24:41 +0200 Subject: [PATCH] add strikethrough highlight --- client/components/codeEditor/codeEditor.less | 4 ++++ .../components/codeEditor/customHighlight.js | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/client/components/codeEditor/codeEditor.less b/client/components/codeEditor/codeEditor.less index 84ed8058d..4ca374291 100644 --- a/client/components/codeEditor/codeEditor.less +++ b/client/components/codeEditor/codeEditor.less @@ -100,6 +100,10 @@ vertical-align : sub; color : rgb(123, 123, 15); } + .cm-strikethrough { + text-decoration: line-through; + } + .cm-definitionList { .cm-definitionTerm { color : rgb(96, 117, 143); } .cm-definitionColon:not(:has(.cm-comment)) { diff --git a/client/components/codeEditor/customHighlight.js b/client/components/codeEditor/customHighlight.js index 0d53e2f33..09a9af18f 100644 --- a/client/components/codeEditor/customHighlight.js +++ b/client/components/codeEditor/customHighlight.js @@ -16,6 +16,7 @@ const customTags = { definitionTerm : 'definitionTerm', // .cm-definitionTerm definitionDesc : 'definitionDesc', // .cm-definitionDesc definitionColon : 'definitionColon', // .cm-definitionColon + strikethrough : 'strikethrough', // .cm-strikethrough //CSS @@ -81,6 +82,23 @@ export function tokenizeCustomMarkdown(text) { } } + // --- Strikethrough --- + if(/\~/.test(lineText)) { + const strikethroughRegex = /~(?!\s)(.+?)(?