jupyter-org-result (text/plain): Be stricter with usage of org-babel-script-escape

This commit is contained in:
Nathaniel Nicandro 2019-01-15 22:55:55 -06:00
parent 0dd3946e1e
commit 09ebdac3f0
No known key found for this signature in database
GPG key ID: C34814B309DD06B8

View file

@ -844,7 +844,14 @@ new \"scalar\" result with the result of calling
(let ((result (cl-call-next-method)))
(jupyter-org-scalar
(cond
((stringp result) (org-babel-script-escape result))
((and (stringp result)
;; Be a little more stringent than `org-babel-script-escape'. It
;; gives bad results on the following
;;
;; [1] Foo bar
(memq (aref result 0) '(?\[ ?\{ ?\())
(eq (aref result 0) (aref result (1- (length result)))))
(org-babel-script-escape result))
(t result)))))
(cl-defmethod jupyter-org-result ((_mime (eql :text/plain)) _params data