1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-22 07:09:47 +00:00

slightly smarter result parsing for js

* lisp/ob-js.el (org-babel-js-read): Match multi-line results.
This commit is contained in:
Eric Schulte 2014-08-23 23:48:48 -04:00
parent 7cf7e4454f
commit 088739b649

View File

@ -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)