From becf95a6447825f91f701e1145a4f3e948d4f2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sat, 4 Apr 2026 22:18:35 +0200 Subject: [PATCH] correct injection highlight --- client/components/codeEditor/customHighlight.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/components/codeEditor/customHighlight.js b/client/components/codeEditor/customHighlight.js index eefdb740a..01b132093 100644 --- a/client/components/codeEditor/customHighlight.js +++ b/client/components/codeEditor/customHighlight.js @@ -81,8 +81,8 @@ export function tokenizeCustomMarkdown(text) { } } + // --- single line def list --- const singleLineRegex = /^([^:\n]*\S)(\s*)(::)([^\n]*)$/dmy; - const match = singleLineRegex.exec(lineText); if(match) { @@ -129,7 +129,7 @@ export function tokenizeCustomMarkdown(text) { return; } - // multiline def list + // --- multiline def list --- if(!/^::/.test(lines[lineNumber]) && lineNumber + 1 < lines.length && /^::/.test(lines[lineNumber + 1])) { const startLine = lineNumber; const defs = []; @@ -189,8 +189,8 @@ export function tokenizeCustomMarkdown(text) { while ((match = injectionRegex.exec(lineText)) !== null) { tokens.push({ line : lineNumber, - from : match.index +1, - to : match.index + match[1].length +1, + from : match.index, + to : match.index + match[1].length, type : customTags.injection, }); }