[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/htmlize 8593a5e 111/134: Put style information in <pre> ta
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/htmlize 8593a5e 111/134: Put style information in <pre> tags. |
Date: |
Sat, 7 Aug 2021 09:17:17 -0400 (EDT) |
branch: elpa/htmlize
commit 8593a5e381a8b305cad3849b524132aae0a3749d
Author: Tamas K. Papp <tkpapp@gmail.com>
Commit: Hrvoje Nikšić <hniksic@gmail.com>
Put style information in <pre> tags.
Fixes https://github.com/hniksic/emacs-htmlize/issues/10.
---
htmlize.el | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/htmlize.el b/htmlize.el
index cbc7205..8abf183 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -1410,8 +1410,8 @@ property and by buffer overlays that specify `face'."
;; use CSS, and others the <font> element. We take an OO approach and
;; define "methods" that indirect to the functions that depend on
;; `htmlize-output-type'. The currently used methods are `doctype',
-;; `insert-head', `body-tag', and `text-markup'. Not all output types
-;; define all methods.
+;; `insert-head', `body-tag', `pre-tag', and `text-markup'. Not all
+;; output types define all methods.
;;
;; Methods are called either with (htmlize-method METHOD ARGS...)
;; special form, or by accessing the function with
@@ -1463,6 +1463,12 @@ it's called with the same value of KEY. All other
times, the cached
nil ; no doc-string
face-map ; shut up the byte-compiler
"<body>")
+
+(defun htmlize-default-pre-tag (face-map)
+ nil ; no doc-string
+ face-map ; shut up the byte-compiler
+ "<pre>")
+
;;; CSS based output support.
@@ -1550,6 +1556,11 @@ it's called with the same value of KEY. All other
times, the cached
(mapconcat #'identity (htmlize-css-specs (gethash 'default face-map))
" ")))
+(defun htmlize-inline-css-pre-tag (face-map)
+ (format "<pre style=\"%s\">"
+ (mapconcat #'identity (htmlize-css-specs (gethash 'default face-map))
+ " ")))
+
(defun htmlize-inline-css-text-markup (fstruct-list buffer)
(let* ((merged (htmlize-merge-faces fstruct-list))
(style (htmlize-memoize
@@ -1573,6 +1584,12 @@ it's called with the same value of KEY. All other
times, the cached
(format "<body text=\"%s\" bgcolor=\"%s\">"
(htmlize-fstruct-foreground fstruct)
(htmlize-fstruct-background fstruct))))
+
+(defun htmlize-font-pre-tag (face-map)
+ (let ((fstruct (gethash 'default face-map)))
+ (format "<pre text=\"%s\" bgcolor=\"%s\">"
+ (htmlize-fstruct-foreground fstruct)
+ (htmlize-fstruct-background fstruct))))
(defun htmlize-font-text-markup (fstruct-list buffer)
;; In `font' mode, we use the traditional HTML means of altering
@@ -1657,7 +1674,7 @@ it's called with the same value of KEY. All other times,
the cached
(insert (htmlize-method body-tag face-map)
"\n ")
(put places 'content-start (point-marker))
- (insert "<pre>\n"))
+ (insert (htmlize-method pre-tag face-map) "\n"))
(let ((text-markup
;; Get the inserter method, so we can funcall it inside
;; the loop. Not calling `htmlize-method' in the loop
- [nongnu] elpa/htmlize 845329e 060/134: Don't attempt to use lexical binding in emacsen that don't support it., (continued)
- [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, 2021/08/07
- [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 <=
- [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
- [nongnu] elpa/htmlize d6dc274 125/134: Remove unused function., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize b9789ba 126/134: Don't warn on the use of font-lock-fontify-buffer in older Emacsen., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 682edbf 130/134: Mention the orgmode mirror., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 4920510 134/134: Fix more cl symbols., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 7b63aa0 131/134: Bump version., ELPA Syncer, 2021/08/07