From 0f7aa0ad49aed5b2cd50110a2196d26b23868707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Wed, 13 May 2026 11:49:41 +0200 Subject: [PATCH] change tok for token --- client/components/codeEditor/codeEditor.jsx | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/client/components/codeEditor/codeEditor.jsx b/client/components/codeEditor/codeEditor.jsx index ba60bf125..254d2977d 100644 --- a/client/components/codeEditor/codeEditor.jsx +++ b/client/components/codeEditor/codeEditor.jsx @@ -119,22 +119,22 @@ const createHighlightPlugin = (renderer, tab)=>{ } }); - tokens.forEach((tok)=>{ - const line = view.state.doc.line(tok.line + 1); + tokens.forEach((token)=>{ + const line = view.state.doc.line(token.line + 1); - if(tok.from != null && tok.to != null && tok.from < tok.to) { - const from = line.from + tok.from; - const to = line.from + tok.to; + if(token.from != null && token.to != null && token.from < token.to) { + const from = line.from + token.from; + const to = line.from + token.to; const attrs = {}; - if(tok.type === 'Image' && tok.url) { + if(token.type === 'Image' && token.url) { - attrs['data-url'] = tok.url; + attrs['data-url'] = token.url; } decos.push( Decoration.mark({ - class : `cm-${tok.type}`, + class : `cm-${token.type}`, ...(Object.keys(attrs).length ? { attributes: attrs } : {}) @@ -143,15 +143,15 @@ const createHighlightPlugin = (renderer, tab)=>{ } else { decos.push( Decoration.line({ - class : `cm-${tok.type}` + class : `cm-${token.type}` }).range(line.from) ); - if(tok.type === 'pageLine' && tab === 'brewText') { + if(token.type === 'pageLine' && tab === 'brewText') { pageCount++; if(line.from === 0) pageCount--; decos.push(Decoration.line({ attributes: { 'data-page-number': pageCount } }).range(line.from)); } - if(tok.type === 'snippetLine' && tab === 'brewSnippets') { + if(token.type === 'snippetLine' && tab === 'brewSnippets') { snippetCount++; decos.push(Decoration.line({ attributes: { 'data-page-number': snippetCount } }).range(line.from)); }