From 088739b64936f792c30de4984a440490de5cfc44 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sat, 23 Aug 2014 23:48:48 -0400 Subject: [PATCH] slightly smarter result parsing for js * lisp/ob-js.el (org-babel-js-read): Match multi-line results. --- lisp/ob-js.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/ob-js.el b/lisp/ob-js.el index 7789449a9..47355b38b 100644 --- a/lisp/ob-js.el +++ b/lisp/ob-js.el @@ -97,14 +97,15 @@ 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 "^\\[[^\000]+\\]$" results)) (org-babel-read (concat "'" (replace-regexp-in-string "\\[" "(" (replace-regexp-in-string "\\]" ")" (replace-regexp-in-string - ", " " " (replace-regexp-in-string - "'" "\"" results)))))) + ",[[:space:]]" " " + (replace-regexp-in-string + "'" "\"" results)))))) results))) (defun org-babel-js-var-to-js (var)