Fix for new lines in invoice JSON

This commit is contained in:
Hillel Coren 2017-06-14 11:01:18 +03:00
parent 13347e949c
commit e75282d585
3 changed files with 4 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -98,9 +98,6 @@ function GetPdfMake(invoice, javascript, callback) {
return val;
}
// escape new lines
javascript = javascript.replace(/\n/g, "\\n").replace(/\r/g, "\\r");
// Add ninja logo to the footer
var dd = JSON.parse(javascript, jsonCallBack);
var designId = invoice.invoice_design_id;
@ -323,6 +320,7 @@ NINJA.decodeJavascript = function(invoice, javascript)
var value = getDescendantProp(invoice, field) || ' ';
value = doubleDollarSign(value);
value = value.replace(/\n/g, "\\n").replace(/\r/g, "\\r");
javascript = javascript.replace(match, '"'+value+'"');
}
}