mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #2251 from kazuhitoyokoi/master-fixsplitnode
Fix escape character handling for separator in split node
This commit is contained in:
commit
ffd10e656e
@ -42,7 +42,7 @@ module.exports = function(RED) {
|
|||||||
node.addname = n.addname || "";
|
node.addname = n.addname || "";
|
||||||
try {
|
try {
|
||||||
if (node.spltType === "str") {
|
if (node.spltType === "str") {
|
||||||
this.splt = (n.splt || "\\n").replace(/\\n/,"\n").replace(/\\r/,"\r").replace(/\\t/,"\t").replace(/\\e/,"\e").replace(/\\f/,"\f").replace(/\\0/,"\0");
|
this.splt = (n.splt || "\\n").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\e/g,"\e").replace(/\\f/g,"\f").replace(/\\0/g,"\0");
|
||||||
} else if (node.spltType === "bin") {
|
} else if (node.spltType === "bin") {
|
||||||
var spltArray = JSON.parse(n.splt);
|
var spltArray = JSON.parse(n.splt);
|
||||||
if (Array.isArray(spltArray)) {
|
if (Array.isArray(spltArray)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user