From d2ca8473f3c61cc1fc7d44c72432e06fca1c468e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 29 Mar 2026 01:53:34 +0100 Subject: [PATCH] small changes --- client/components/codeEditor/customHighlight.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/components/codeEditor/customHighlight.js b/client/components/codeEditor/customHighlight.js index a91f25281..d0522520a 100644 --- a/client/components/codeEditor/customHighlight.js +++ b/client/components/codeEditor/customHighlight.js @@ -85,7 +85,7 @@ export function tokenizeCustomMarkdown(text) { return; //if line only has colons, stops } - const singleLineRegex = /^([^:\n]*\S)(::)([^\n]*)$/dmy; + const singleLineRegex = /^([^:\n]*\S)\s*(::)([^\n]*)$/dmy; const match = singleLineRegex.exec(lineText); @@ -253,6 +253,8 @@ export function tokenizeCustomCSS(text) { return tokens; } + +console.log(tags); //assign classes to tags provided by lezer, not unlike the function above export const customHighlightStyle = HighlightStyle.define([ { tag: tags.heading, class: 'cm-header' }, @@ -269,6 +271,8 @@ export const customHighlightStyle = HighlightStyle.define([ { tag: tags.strong, class: 'cm-strong' }, { tag: tags.emphasis, class: 'cm-em' }, { tag: tags.quote, class: 'cm-quote' }, + { tag: tags.comment, class: 'cm-comment' }, + { tag: tags.monospace, class: 'cm-comment' }, //css tags @@ -284,7 +288,7 @@ export const customHighlightStyle = HighlightStyle.define([ { tag: tags.paren, class: 'cm-paren' }, { tag: tags.variableName, class: 'cm-variable' }, { tag: tags.invalid, class: 'cm-error' }, - { tag: tags.comment, class: 'cm-comment' }, + ]);