Prevent leaking ANSI sequences when inserting text/plain results

* jupyter-mime.el (jupyter-insert): Do it.
This commit is contained in:
Nathaniel Nicandro 2022-11-06 17:13:33 -06:00
parent 2e8689227f
commit 3736ae753a

View file

@ -549,6 +549,9 @@ width and height of the image."
(cl-defmethod jupyter-insert ((_mime (eql :text/plain)) data
&optional _metadata)
;; Reset the context so that it doesn't leak into DATA if DATA has
;; no ANSI sequences.
(setq ansi-color-context nil)
(jupyter-insert-ansi-coded-text data)
(insert "\n"))