emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 745ec75677b 1/2: Fix 'shr-put-image' with nil value for ALT


From: Eli Zaretskii
Subject: master 745ec75677b 1/2: Fix 'shr-put-image' with nil value for ALT
Date: Sat, 16 Dec 2023 07:53:13 -0500 (EST)

branch: master
commit 745ec75677b3768f9adc436303f3886b88f6f569
Author: Visuwesh <visuweshm@gmail.com>
Commit: Eli Zaretskii <eliz@gnu.org>

    Fix 'shr-put-image' with nil value for ALT
    
    * lisp/net/shr.el (shr-put-image): Account for nil value for ALT.
    (Bug#67764)
---
 lisp/net/shr.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index e0888c61496..8a24a4f6696 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]