Subject: Re: bug#67764: 30.0.50; Opening image in eww no longer works

From: Visuwesh <[email-masked]>
Date: Tue, 12 Dec 2023 14:44:12 +0530

[Tuesday December 12, 2023] Manuel Giraud wrote:

> Visuwesh <[email-masked]> writes:
>
> [...]
>
>> diff --git a/lisp/net/shr.el b/lisp/net/shr.el
>> index 9f030b4c743..bf5038a421d 100644
>> --- a/lisp/net/shr.el
>> +++ b/lisp/net/shr.el
>> @@ -1137,7 +1137,9 @@ shr-put-image
>>          (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#6774).
>
> There is a 6 missing in the bug reference ;-)

...and in the commit log.  I don't know how I managed to mess it up.
Thanks for catching the mistake.  Revised patch attached.

>From 4327fb4eae80b217437fbabae6c2ef7c6ac940a3 Mon Sep 17 00:00:00 2001
From: Visuwesh <[email-masked]>
Date: Mon, 11 Dec 2023 17:09:03 +0530
Subject: [PATCH] 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 9f030b4c743..d6ea5213337 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1137,7 +1137,9 @@ shr-put-image
         (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)))
-- 
2.42.0