From b2bb4397ddcef5819747d9046b60e578c2fd0691 Mon Sep 17 00:00:00 2001 From: Snorre Date: Tue, 25 Mar 2025 12:05:13 +0100 Subject: [PATCH] fixed highlighting highlighting keywords inside other words --- public/js/code_highlighter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/js/code_highlighter.js b/public/js/code_highlighter.js index b959812..ac2ee26 100644 --- a/public/js/code_highlighter.js +++ b/public/js/code_highlighter.js @@ -24,6 +24,10 @@ const match = (m) => (peek, take) => { return true; } const match_identifier = (m) => (peek, take) => { + try { + if (peek(-1).match(/[0-9a-z_]/)) + return false; + } catch {} if (match(m)(peek, take)) { if (peek(0).match(/[0-9a-z]/)) { take(-m.length);