From 2c8214a8e45a6368c709ae26d6d20c7458ebe0dd Mon Sep 17 00:00:00 2001 From: Peter Moresi Date: Tue, 18 Nov 2014 15:58:17 -0800 Subject: [PATCH] Fix problem passing multiline variables into JS source code block --- lisp/ob-js.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-js.el b/lisp/ob-js.el index 47355b3..1a95216 100644 --- a/lisp/ob-js.el +++ b/lisp/ob-js.el @@ -114,7 +114,7 @@ Convert an elisp value into a string of js source code specifying a variable of the same value." (if (listp var) (concat "[" (mapconcat #'org-babel-js-var-to-js var ", ") "]") - (format "%S" var))) + (replace-regexp-in-string "\n" "\\\\n" (format "%S" var)))) (defun org-babel-prep-session:js (session params) "Prepare SESSION according to the header arguments specified in PARAMS." -- 1.7.10.4