ob-js: Fix passing multiline variables
* lisp/ob-js.el (org-babel-js-var-to-js): Replace newline characters
with "\n" in strings.
Let's say I have a multi-line string stored in an example block.
I want to store my CSV in an example block.
ColA,ColB,ColC
1,2,3
4,5,6
I have a JavaScript function that accepts a string named 'csv' and passing in 'my-csv-data'.
console.log(csv);
When I expand the source block I end up with:
var csv="ColA,ColB,ColC
1,2,3
4,5,6";
console.log(csv);
This will not execute correctly because JavaScript does not support newlines in strings.
What I want instead is:
var csv="ColA,ColB,ColC\n 1,2,3\n 4,5,6";
console.log(csv);
TINYCHANGE