From 6c273f423cc2f72786f74f0d76b1b34a3ccdb1d5 Mon Sep 17 00:00:00 2001 From: James Leach Date: Mon, 11 Feb 2019 18:34:59 -0600 Subject: [PATCH] Potential fix for #19 (and #32): Multiple line Gcode commands must be sent as an array of strings. --- octoprint_klipper/static/js/klipper_param_macro.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/octoprint_klipper/static/js/klipper_param_macro.js b/octoprint_klipper/static/js/klipper_param_macro.js index 502b3cb..fc305be 100644 --- a/octoprint_klipper/static/js/klipper_param_macro.js +++ b/octoprint_klipper/static/js/klipper_param_macro.js @@ -62,8 +62,9 @@ $(function() { } expanded = self.macro.replace(paramObjRegex, replaceParams) - expanded = expanded.replace(/(?:\r\n|\r|\n)/g, " "); - + expanded = "[\"" + expanded + "\"]" + expanded = expanded.replace(/(?:\r\n|\r|\n)/g, "\",\""); + OctoPrint.control.sendGcode(expanded); } }