[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/htmlize 73333fc 068/134: Add an option `htmlize-use-images
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/htmlize 73333fc 068/134: Add an option `htmlize-use-images' to turn off image generation. |
Date: |
Sat, 7 Aug 2021 09:17:09 -0400 (EDT) |
branch: elpa/htmlize
commit 73333fca2c0b44ce41e4b3b765e79149deb7ec59
Author: Hrvoje Niksic <hniksic@gmail.com>
Commit: Hrvoje Niksic <hniksic@gmail.com>
Add an option `htmlize-use-images' to turn off image generation.
---
htmlize.el | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/htmlize.el b/htmlize.el
index 311fb7c..1553277 100644
--- a/htmlize.el
+++ b/htmlize.el
@@ -131,6 +131,11 @@ sheet to carry around)."
:type '(choice (const css) (const inline-css) (const font))
:group 'htmlize)
+(defcustom htmlize-use-images t
+ "*Whether htmlize generates `img' for images attached to buffer contents."
+ :type 'boolean
+ :group 'htmlize)
+
(defcustom htmlize-generate-hyperlinks t
"*Non-nil means generate the hyperlinks for URLs and mail addresses.
This is on by default; set it to nil if you don't want htmlize to
@@ -417,10 +422,12 @@ next-single-char-property-change")))
(defun htmlize-usable-display-prop (display)
(or (stringp display)
- (eq (car-safe display) 'image)))
+ (and htmlize-use-images
+ (eq (car-safe display) 'image))))
-(defun htmlize-decode-display-prop (display)
+(defun htmlize-display-prop-to-html (display)
(if (stringp display)
+ ;; Emacs ignores recursive display properties.
(htmlize-protect-string display)
(htmlize-generate-image (cdr display))))
@@ -440,7 +447,9 @@ next-single-char-property-change")))
(setq display (get-char-property pos 'display string)
next-change (next-single-property-change pos 'display string end))
(if (htmlize-usable-display-prop display)
- (push (htmlize-decode-display-prop display) outlist)
+ (push (htmlize-display-prop-to-html display) outlist)
+ ;; If we don't interpret the display prop, ignore it and show
+ ;; the string.
(push (htmlize-protect-string (substring string pos next-change))
outlist))
(setq pos next-change))
- [nongnu] elpa/htmlize c34b364 053/134: Create an image with a data: URI for image data descriptors., (continued)
- [nongnu] elpa/htmlize c34b364 053/134: Create an image with a data: URI for image data descriptors., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize c13175c 058/134: Don't use CL's lexical-let if lexical binding is in use., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 97b6b8d 078/134: Escape link text., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 5ce4c6e 083/134: Support XEmacs again., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize aa6e2f6 096/134: Removed support for GNU Emacs 21., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 29f3960 104/134: Nicer readme., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize fb85e84 005/134: Version 0.45., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 94faffa 056/134: Just use `locate-file'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 3551c6b 063/134: Respect `before-string' and `after-string' overlay properties., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 3ed76d8 065/134: Use find-image to find the actual location of the image file in image-load-path., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 73333fc 068/134: Add an option `htmlize-use-images' to turn off image generation.,
ELPA Syncer <=
- [nongnu] elpa/htmlize 5e04b38 072/134: Improve docs., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 1ea27b3 071/134: Escape double quote in attribute values., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 18693fd 081/134: Bumped version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 4f0e317 085/134: Show `display' strings with the `htmlize-literal' property as raw HTML., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 4538849 088/134: Bumped version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 0a17c7c 087/134: It's `htmlize-running-xemacs', not `running-xemacs'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 6f9bb1f 100/134: Bump version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize f74ea31 106/134: Bump version., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 32c69e9 108/134: Add htmlize-face-overrides., ELPA Syncer, 2021/08/07
- [nongnu] elpa/htmlize 1f7bd72 110/134: Update supported version from 21 -> 22 in README, ELPA Syncer, 2021/08/07