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:
parent
7cf7e4454f
commit
088739b649
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user