From 792b89a0922ee21bd0155f68adb0ce07c2558a51 Mon Sep 17 00:00:00 2001 From: Josh Berry Date: Mon, 4 Aug 2014 22:46:46 -0400 Subject: [PATCH 2/2] Fix javascript exporting of results from node.js * ob-js.el (org-babel-js-read): Expand regexps to account for newlines in output from node.js It may be possible to instruct node.js to not insert line breaks automatically. Was not difficult to fix the regular expressions to account for newlines, though. I did *not* add a test file that goes over this, as I did not see one already for ob-js.el. I can certainly add one, if desired. TINYCHANGE --- lisp/ob-js.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ob-js.el b/lisp/ob-js.el index 7789449..9d956cc 100644 --- a/lisp/ob-js.el +++ b/lisp/ob-js.el @@ -97,13 +97,13 @@ This function is called by `org-babel-execute-src-block'" If RESULTS look like a table, then convert them into an Emacs-lisp table, otherwise return the results as a string." (org-babel-read - (if (and (stringp results) (string-match "^\\[.+\\]$" results)) + (if (and (stringp results) (string-match "^\\[[\0-\377[:nonascii:]]*\\]$" results)) (org-babel-read (concat "'" (replace-regexp-in-string "\\[" "(" (replace-regexp-in-string "\\]" ")" (replace-regexp-in-string - ", " " " (replace-regexp-in-string + ",\\W" " " (replace-regexp-in-string "'" "\"" results)))))) results))) -- 1.9.1