forked from mirrors/org-mode
ob-sh: can now handle variable strings which contain newlines
* lisp/ob-sh.el (org-babel-sh-var-to-sh): shell can now handle input strings which contain newlines
This commit is contained in:
parent
f904376df4
commit
57bfa1989d
|
@ -113,7 +113,11 @@ var of the same value."
|
||||||
(format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)"
|
(format "$(cat <<BABEL_TABLE\n%s\nBABEL_TABLE\n)"
|
||||||
(orgtbl-to-generic
|
(orgtbl-to-generic
|
||||||
(deep-string var) (list :sep (or sep "\t")))))
|
(deep-string var) (list :sep (or sep "\t")))))
|
||||||
(if (stringp var) (format "%s" var) (format "%S" var))))
|
(if (stringp var)
|
||||||
|
(if (string-match "[\n\r]" var)
|
||||||
|
(format "$(cat <<BABEL_STRING\n%s\nBABEL_STRING\n)" var)
|
||||||
|
(format "%s" var))
|
||||||
|
(format "%S" var))))
|
||||||
|
|
||||||
(defun org-babel-sh-table-or-results (results)
|
(defun org-babel-sh-table-or-results (results)
|
||||||
"Convert RESULTS to an appropriate elisp value.
|
"Convert RESULTS to an appropriate elisp value.
|
||||||
|
|
Loading…
Reference in New Issue