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

I guess I should actually run the tests before uploading to github...
This commit is contained in:
Nathaniel Nicandro 2019-01-16 18:50:02 -06:00
parent 4a392fce68
commit 9b955398cd
No known key found for this signature in database
GPG key ID: C34814B309DD06B8
2 changed files with 9 additions and 3 deletions

View file

@ -850,8 +850,12 @@ new \"scalar\" result with the result of calling
;; gives bad results on the following
;;
;; [1] Foo bar
(memq (aref result 0) '(?\[ ?\{ ?\())
(eq (aref result 0) (aref result (1- (length result)))))
(when-let* ((beg (car (memq (aref result 0) '(?\[ ?\{ ?\())))
(end (and beg (pcase beg
(?\[ ?\])
(?\{ ?\})
(?\( ?\))))))
(eq end (aref result (1- (length result))))))
(org-babel-script-escape result))
(t result)))))

View file

@ -1242,7 +1242,9 @@ Image(filename='%s', width=300)" file)
'(export-block (:type "html" :value "foo\n"))))
;; Calls `org-babel-script-escape' for scalar data
(should (equal (jupyter-org-result req (list :text/plain "[1, 2, 3]"))
"| 1 | 2 | 3 |\n"))))
"| 1 | 2 | 3 |\n"))
(should (equal (jupyter-org-result req (list :text/plain "[1, 2, 3] Foo"))
'(fixed-width (:value "[1, 2, 3] Foo"))))))
(ert-deftest jupyter-org-result-python ()
:tags '(org)