]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix 'shr-put-image' with nil value for ALT
authorVisuwesh <visuweshm@gmail.com>
Mon, 11 Dec 2023 11:39:03 +0000 (17:09 +0530)
committerEshel Yaron <me@eshelyaron.com>
Sat, 16 Dec 2023 19:16:13 +0000 (20:16 +0100)
* lisp/net/shr.el (shr-put-image): Account for nil value for ALT.
(Bug#67764)

(cherry picked from commit 745ec75677b3768f9adc436303f3886b88f6f569)

lisp/net/shr.el

index e0888c614964ebbc69e604950cbf0f788cfb0ce4..8a24a4f669675b73c646f35526f28942d9b9ca88 100644 (file)
@@ -1137,7 +1137,9 @@ element is the data blob and the second element is the content-type."
         (when image
           ;; The trailing space can confuse shr-insert into not
           ;; putting any space after inline images.
-         (setq alt (string-trim alt))
+          ;; ALT may be nil when visiting image URLs in eww
+          ;; (bug#67764).
+         (setq alt (if alt (string-trim alt) "*"))
          ;; When inserting big-ish pictures, put them at the
          ;; beginning of the line.
          (let ((inline (shr--inline-image-p image)))