Nicolas Goaziou преди 10 години
родител
ревизия
3953cb19b4
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      lisp/ob-js.el

+ 1 - 1
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."
 specifying a variable of the same value."
   (if (listp var)
   (if (listp var)
       (concat "[" (mapconcat #'org-babel-js-var-to-js 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)
 (defun org-babel-prep-session:js (session params)
   "Prepare SESSION according to the header arguments specified in PARAMS."
   "Prepare SESSION according to the header arguments specified in PARAMS."