diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2014-08-23 23:48:48 -0400 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2014-08-23 23:49:37 -0400 |
commit | 088739b64936f792c30de4984a440490de5cfc44 (patch) | |
tree | 88b81e16e8e9a7c88eafc946d4d7347203ade7ff | |
parent | 7cf7e4454fb05ce8bd0d4ca5629b2f409478525c (diff) | |
download | org-mode-088739b64936f792c30de4984a440490de5cfc44.tar.gz |
slightly smarter result parsing for js
* lisp/ob-js.el (org-babel-js-read): Match multi-line results.
-rw-r--r-- | lisp/ob-js.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/ob-js.el b/lisp/ob-js.el index 7789449..47355b3 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) |