diff --git a/jupyter-org-client.el b/jupyter-org-client.el index 2f2c157..94a73af 100644 --- a/jupyter-org-client.el +++ b/jupyter-org-client.el @@ -579,7 +579,7 @@ property." (jupyter-org--ansi-color-apply-on-region beg1 end))) ;; fixed width (t - (setq end (or (and (re-search-forward "^[ \t]*[^:]" nil t) + (setq end (or (and (re-search-forward "^[ \t]*[^ \t:]" nil t) (1- (match-beginning 0))) (point-max))) (jupyter-org--ansi-color-apply-on-region beg end))))))) diff --git a/test/jupyter-test.el b/test/jupyter-test.el index a2c1d29..6ce3bc7 100644 --- a/test/jupyter-test.el +++ b/test/jupyter-test.el @@ -2314,7 +2314,20 @@ ABCDEF #+end_example") ;; Test the cached faces path (remove-text-properties (point-min) (point-max) '(face)) - (funcall test-fun 24 '(19 20 21 22 23 26 27 28 29))))) + (funcall test-fun 24 '(19 20 21 22 23 26 27 28 29)))) + (ert-info ("Leading indentation") + (with-temp-buffer + (org-mode) + (jupyter-org-interaction-mode 1) + (pop-to-buffer (current-buffer)) + (let ((beg (+ (point-min) 2)) end) + (insert " : ABCDEF\n") + (insert " : ABCDEF\n") + (setq end (1- (point))) + (insert "hey\n") + (goto-char (point-min)) + (jupyter-org-font-lock-ansi-escapes (point-max)) + (should-not (text-property-not-all beg end 'jupyter-ansi t)))))) (ert-deftest jupyter-org-closest-jupyter-language () :tags '(org)