diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js index a653c9d7e..e8cab04e7 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/library.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/library.js @@ -69,7 +69,7 @@ RED.library = (function() { if (field === "name") { data.name = name; } else if (field === "info") { - data.info = activeLibrary.nodeInfoEditor.getValue().replace(/\n/g, "\\n"); + data.info = activeLibrary.nodeInfoEditor.getValue().replace(/\\/g, "\\\\").replace(/\n/g, "\\n"); } else { data[field] = $("#" + elementPrefix + field).val(); } @@ -526,7 +526,7 @@ RED.library = (function() { for (var i = 0; i < activeLibrary.fields.length; i++) { var field = activeLibrary.fields[i]; if (field === "info") { - var nodeInfo = selectedLibraryItem[field].replace(/\\n/g, "\n"); + var nodeInfo = selectedLibraryItem[field].split("\\\\").map(function (v) { return v.replace(/\\n/g, "\n"); }).join("\\"); activeLibrary.nodeInfoEditor.setValue(nodeInfo, -1); } else { $("#" + elementPrefix + field).val(selectedLibraryItem[field]);