emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/htmlize 567d55c 124/134: Don't convert ^L to <hr/> in invi


From: ELPA Syncer
Subject: [nongnu] elpa/htmlize 567d55c 124/134: Don't convert ^L to <hr/> in invisible text.
Date: Sat, 7 Aug 2021 09:17:20 -0400 (EDT)

branch: elpa/htmlize
commit 567d55c2a1c39822e22cea55393d4bcc7338ccd3
Author: Hrvoje Niksic <hniksic@gmail.com>
Commit: Hrvoje Niksic <hniksic@gmail.com>

    Don't convert ^L to <hr/> in invisible text.
---
 htmlize.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/htmlize.el b/htmlize.el
index 19cab58..87207ef 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -826,7 +826,15 @@ This is used to protect mailto links without modifying 
their meaning."
     (put-text-property 0 (length s) 'htmlize-literal t s)
     (let ((disp `(display ,s)))
       (while (re-search-forward "\n\^L" nil t)
-        (htmlize-make-tmp-overlay (match-beginning 0) (match-end 0) disp)))))
+        (let* ((beg (match-beginning 0))
+               (end (match-end 0))
+               (form-feed-pos (1+ beg))
+               ;; don't process ^L if invisible or covered by `display'
+               (show (and (htmlize-decode-invisibility-spec
+                           (get-char-property form-feed-pos 'invisible))
+                          (not (get-char-property form-feed-pos 'display)))))
+          (when show
+            (htmlize-make-tmp-overlay beg end disp)))))))
 
 (defun htmlize-defang-local-variables ()
   ;; Juri Linkov reports that an HTML-ized "Local variables" can lead



reply via email to

[Prev in Thread] Current Thread [Next in Thread]