From 54acfb567211215d8a11c0c4e64a15edf99241a0 Mon Sep 17 00:00:00 2001 From: barthy Date: Tue, 30 Apr 2024 08:51:09 +0200 Subject: [PATCH] enh(gcode): test for uderscores to align with regex --- src/languages/gcode.js | 4 ++++ test/markup/gcode/extended.expect.txt | 2 ++ test/markup/gcode/extended.txt | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/languages/gcode.js b/src/languages/gcode.js index a26b2a7849..405cf0fa9b 100644 --- a/src/languages/gcode.js +++ b/src/languages/gcode.js @@ -76,6 +76,10 @@ export default function(hljs) { return; } + if (charBeforeMatch === '_') { + return; + } + response.ignoreMatch(); } diff --git a/test/markup/gcode/extended.expect.txt b/test/markup/gcode/extended.expect.txt index 954d2f3a2a..166c830f19 100644 --- a/test/markup/gcode/extended.expect.txt +++ b/test/markup/gcode/extended.expect.txt @@ -81,4 +81,6 @@ SET_SKEW XY=100.0000, SKEW_PROFILE SAVE="this name has spaces" SAVE_CONFIG +SKEW_PROFILE SAVE=some_ G123 +SKEW_PROFILE SAVE=some_G123 % diff --git a/test/markup/gcode/extended.txt b/test/markup/gcode/extended.txt index dbcf52ed7b..b6b81a107d 100644 --- a/test/markup/gcode/extended.txt +++ b/test/markup/gcode/extended.txt @@ -81,4 +81,6 @@ SET_SKEW XY=100.0000,100.0000,70.7107 SKEW_PROFILE SAVE="this name has spaces" SAVE_CONFIG +SKEW_PROFILE SAVE=some_ G123 +SKEW_PROFILE SAVE=some_G123 %