mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 07:41:37 -05:00
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:
parent
4a392fce68
commit
9b955398cd
2 changed files with 9 additions and 3 deletions
|
@ -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)))))
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue