Skip to content

Commit

Permalink
enh(gcode): test for uderscores to align with regex
Browse files Browse the repository at this point in the history
  • Loading branch information
barthy-koeln committed Apr 30, 2024
1 parent cfdb60d commit e063f58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/languages/gcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ export default function(hljs) {
return;
}

if (charBeforeMatch === '_') {
return;
}

response.ignoreMatch();
}

Expand Down
2 changes: 2 additions & 0 deletions test/markup/gcode/extended.expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ SET_SKEW XY=<span class="hljs-number">100.0000</span>,<span class="hljs-number">
SKEW_PROFILE SAVE=<span class="hljs-string">&quot;this name has spaces&quot;</span>
SAVE_CONFIG

SKEW_PROFILE SAVE=some_ <span class="hljs-title function_">G123</span>
SKEW_PROFILE SAVE=some_<span class="hljs-title function_">G123</span>
<span class="hljs-keyword">%</span>
2 changes: 2 additions & 0 deletions test/markup/gcode/extended.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
%

0 comments on commit e063f58

Please sign in to comment.