mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Fix ein:worksheet-to-json
When there is no metadata, do not include it in JSON data to avoid converting nil to JSON (which yields null).
This commit is contained in:
parent
f1f94d772d
commit
0bf9cce4b7
2 changed files with 4 additions and 1 deletions
|
@ -228,7 +228,7 @@ current buffer."
|
|||
c (ein:funcall-packed discard-output-p c)))
|
||||
(ein:worksheet-get-cells ws)))))
|
||||
`((cells . ,(apply #'vector cells))
|
||||
(metadata . ,(oref ws :metadata)))))
|
||||
,@(ein:aand (oref ws :metadata) `((metadata . ,it))))))
|
||||
|
||||
(defmethod ein:worksheet-save-cells ((ws ein:worksheet))
|
||||
"Save cells in worksheet buffer in cache before killing the buffer.
|
||||
|
|
|
@ -23,6 +23,9 @@
|
|||
(ein:worksheet-from-json ws-1
|
||||
(ein:json-read-from-string
|
||||
(json-encode json-0))))))
|
||||
(let* ((found (assoc 'metadata json-0)))
|
||||
(when found
|
||||
(should (cdr found))))
|
||||
(should (equal json-0 json-1))))
|
||||
|
||||
(ert-deftest ein:worksheet-to-json/empty ()
|
||||
|
|
Loading…
Add table
Reference in a new issue