diff --git a/lisp/ob-js.el b/lisp/ob-js.el index 47355b38b..e12678734 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."