Anonymous

Module:GameData/doc: Difference between revisions

From Melvor Idle
Change escape logic
(Update for v1.2/AoD)
(Change escape logic)
Line 84: Line 84:
}
}
escapeQuotes(data) {
escapeQuotes(data) {
var newData = data.replace(/\'/g, "\\\'");
var newData = data.replace(/\\/g, '\\\\')
newData = newData.replace(/\\\"/g, "\\\\\"");
newData = newData.replace(/'/g, "\\'");
newData = newData.replace(/"/g, '\\"');
return newData;
return newData;
}
}