branch: elpa/htmlize
commit 567d55c2a1c39822e22cea55393d4bcc7338ccd3
Author: Hrvoje Niksic <[email protected]>
Commit: Hrvoje Niksic <[email protected]>
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