[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/htmlize 67b8bf3 086/134: Implement form feed replacement w
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/htmlize 67b8bf3 086/134: Implement form feed replacement with <hr/> as a temporary overlay with |
Date: |
Sat, 7 Aug 2021 09:17:12 -0400 (EDT) |
branch: elpa/htmlize
commit 67b8bf39a80df2847ca2244735986ff42fb71c92
Author: Hrvoje Niksic <hniksic@gmail.com>
Commit: Hrvoje Niksic <hniksic@gmail.com>
Implement form feed replacement with <hr/> as a temporary overlay with
the `display' property.
---
htmlize.el | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/htmlize.el b/htmlize.el
index 4340d1c..8119fbe 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -833,6 +833,13 @@ This is used to protect mailto links without modifying
their meaning."
;; <hniksic@xemacs.org>
;; <xalan-dev-sc.10148567319.hacuhiucknfgmpfnjcpg-john=doe.com@xml.apache.org>
+(defun htmlize-shadow-form-feeds ()
+ (let ((s "\n<hr />"))
+ (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)))))
+
(defun htmlize-defang-local-variables ()
;; Juri Linkov reports that an HTML-ized "Local variables" can lead
;; visiting the HTML to fail with "Local variables list is not
@@ -1609,6 +1616,8 @@ it's called with the same value of KEY. All other times,
the cached
(buffer-name))))
(when htmlize-generate-hyperlinks
(htmlize-create-auto-links))
+ (when htmlize-replace-form-feeds
+ (htmlize-shadow-form-feeds))
;; Initialize HTMLBUF and insert the HTML prolog.
(with-current-buffer htmlbuf
@@ -1687,18 +1696,6 @@ it's called with the same value of KEY. All other
times, the cached
(put places 'body-end (point-marker))
(insert "\n</html>\n")
(htmlize-defang-local-variables)
- (when htmlize-replace-form-feeds
- ;; Change each "\n^L" to "<hr />".
- (goto-char (point-min))
- (let ((source
- ;; ^L has already been escaped, so search for that.
- (htmlize-protect-string "\n\^L"))
- (replacement
- (if (stringp htmlize-replace-form-feeds)
- htmlize-replace-form-feeds
- "</pre><hr /><pre>")))
- (while (search-forward source nil t)
- (replace-match replacement t t))))
(goto-char (point-min))
(when htmlize-html-major-mode
;; What sucks about this is that the minor modes, most notably
- [nongnu] elpa/htmlize 86f22f2 132/134: Add Homepage to the package header, (continued)
- [nongnu] elpa/htmlize 86f22f2 132/134: Add Homepage to the package header, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 999eef2 032/134: Support searching for any property change., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 7f94aa2 039/134: Conditionalize on color-instance-rgb-components., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 34845c5 042/134: Update comment., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize c847998 057/134: The future has come: switch to lexical scope., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 845329e 060/134: Don't attempt to use lexical binding in emacsen that don't support it., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a6f9f07 066/134: Decide at each macroexpansion whether to use `lexical-let' or `let'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 58775c8 064/134: Improve introductory text., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize db4b76e 076/134: New file: NEWS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 87d4a43 080/134: Recognize tmp overlays with an overlay property., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 67b8bf3 086/134: Implement form feed replacement with <hr/> as a temporary overlay with,
ELPA Syncer <=
- [nongnu] elpa/htmlize 9e4c0bc 089/134: Faces that come first take precedence over those that come later., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5d9be53 093/134: Bumped version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize ece5b5f 095/134: Bumped version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 974c169 098/134: Set `lexical-binding' to `t' in the first line of the file., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 8593a5e 111/134: Put style information in <pre> tags., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize a0b55cb 112/134: Introduced option for styling <pre>, "screenshot" function., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 133ac35 115/134: Remove XEmacs support., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 75c21c7 116/134: Use `font-lock-ensure' where available. (#14), ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 315a8f2 121/134: htmlize-sorted-overlays-at: correctly initialize OVERLAYS. (#18), ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize e01bb6f 123/134: Bump version., ELPA Syncer, 2021/08/07