From 0b0eca31a4ba0f721b8d8869c4fcf1a242212312 Mon Sep 17 00:00:00 2001 From: Dean Cording Date: Sat, 3 Sep 2022 12:52:57 +1000 Subject: [PATCH] Remove all T0 commands, not just the first one Fix for issue #391 Changed regex to do a global replace instead of a single replace. This will remove all instances of the T0 command instead of just the first one. --- js/gcodeprocessing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/gcodeprocessing.js b/js/gcodeprocessing.js index ffd38b0..ab51140 100644 --- a/js/gcodeprocessing.js +++ b/js/gcodeprocessing.js @@ -693,7 +693,7 @@ function processGcode(formName) { gcode = gcode.replace(/;M80/, "M80"); } if(formName.removet0.checked == true) { - gcode = gcode.replace(/T0\n/, ";T0\n"); + gcode = gcode.replace(/T0\n/g, ";T0\n"); } if(formName.start.checked == true) { gcode = gcode.replace(/;customstart/, "; custom start gcode\n"+customStart);