From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#67764: 30.0.50; Opening image in eww no longer works Date: Tue, 12 Dec 2023 09:42:54 +0530 Message-ID: <87r0jst5x5.fsf@gmail.com> References: <87msuhfdjr.fsf@pub.pink> <87sf49ge7i.fsf@gmail.com> <83edfsvj0a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30485"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 67764@debbugs.gnu.org, jm@pub.pink To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 12 05:14:26 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rCuA6-0007kE-K8 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 12 Dec 2023 05:14:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCu9V-0006UD-LQ; Mon, 11 Dec 2023 23:13:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCu9T-0006Tt-GR for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 23:13:47 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rCu9T-0006zP-89 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 23:13:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCu9i-0000WU-2h for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 23:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Dec 2023 04:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67764 X-GNU-PR-Package: emacs Original-Received: via spool by 67764-submit@debbugs.gnu.org id=B67764.17023544041947 (code B ref 67764); Tue, 12 Dec 2023 04:14:02 +0000 Original-Received: (at 67764) by debbugs.gnu.org; 12 Dec 2023 04:13:24 +0000 Original-Received: from localhost ([127.0.0.1]:55082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCu95-0000VJ-MP for submit@debbugs.gnu.org; Mon, 11 Dec 2023 23:13:24 -0500 Original-Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:42250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCu90-0000V4-Rj for 67764@debbugs.gnu.org; Mon, 11 Dec 2023 23:13:22 -0500 Original-Received: by mail-pf1-x444.google.com with SMTP id d2e1a72fcca58-6cebbf51742so3608824b3a.1 for <67764@debbugs.gnu.org>; Mon, 11 Dec 2023 20:13:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702354378; x=1702959178; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=p1NXD1x05k0kouWTtE3wzWoyC3zKDdJP71Q8rNX6wP8=; b=nlvdfdj59PfE4+0Qj3tEyXouG6CU0nMdsHDGT6ikjXwqH0ek02NxZL6YTbUKEb79eq T3Lt2LNDk07I77RbZJCkYenOyIBr/poBFLYCeS/R2csG0AsZNtfGf7Mfu2MXlAo0YZju VH6mgshRfE4DMjFxKV/WbupmSDnXQoSbSs0DxCIwZG1fJi0v1mvgWskGIMLuQXaJBZsr Op+X+cVqs7deElYD7CNNUF3Ikx0GxTwFiP/gDk02dF/MeEHrfeX4TMiN52GSfN9YmeO5 zphUzY3EM43IyFZbgX6pB3K6HlDVtihY6aBBYcT1mlS/scLqKNcBpkQqTVg2MZgB9xNs Effg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702354378; x=1702959178; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=p1NXD1x05k0kouWTtE3wzWoyC3zKDdJP71Q8rNX6wP8=; b=Ccs4TrTPJxpLA1ybY8R4bOdZ+6TfqoB2jZYQzKx+yihpq5Vum/zxiDAHw+WzJyasD0 e2IUedVqvp5SNRX8fl3+uT4HX9XdgJX9m8JN3Q1TMb7tWG/M1OU9nV4XYV5R6EMsJ984 s4Yn0lOJBJXkuaQsNegBXluC3+H/jUlRXtUNWL3o6sW9Uad5bcu+EIuacjB9v9/EEqtO U4gAAXI8obj1KQekl8hM5YiVDWQGu1ZBI8vy/W7BW56Fa+4mzeS+EEPgzNZluHx7w5O9 GWqa8Gp56eMtygS4J1Tn6JXzlFkWBpztbtRApvZvFcL9tn81FTgXA1cBVEhCeHbGnrf4 WTZQ== X-Gm-Message-State: AOJu0YzfGgFGsFLQEP0cmPwoRAnCPy0QjcQCBkVPOp3AKB+M5aKMTjxn EToXu48g6+hKC/MaflOPHEBU+KRKUz5DBSJX X-Google-Smtp-Source: AGHT+IHrmlJ1t4/aDgfsEdj2/tgIrRU9Fb2tcv3ELJgT+MHWLuBZn8eMN5G52yApv9mTgxnry7gg9g== X-Received: by 2002:aa7:88c6:0:b0:6ce:7a8f:af81 with SMTP id k6-20020aa788c6000000b006ce7a8faf81mr7342279pff.28.1702354377891; Mon, 11 Dec 2023 20:12:57 -0800 (PST) Original-Received: from localhost ([49.204.128.180]) by smtp.gmail.com with ESMTPSA id b17-20020a056a000cd100b0068ffb8da107sm6973500pfv.212.2023.12.11.20.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 20:12:57 -0800 (PST) In-Reply-To: <83edfsvj0a.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Dec 2023 17:47:17 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276014 Archived-At: --=-=-= Content-Type: text/plain [Monday December 11, 2023] Eli Zaretskii wrote: >> Cc: 67764@debbugs.gnu.org >> From: Visuwesh >> Date: Mon, 11 Dec 2023 17:10:01 +0530 >> >> > emacs -Q >> > M-: (eww "https://www.gnu.org/software/emacs/images/emacs.png") >> > >> > On master it fails with "Wrong type argument: stringp, nil". >> > Bisect says 4254544 is the first bad commit. >> >> Recent changes in shr-put-image didn't account for the possible nil >> value for ALT. Attached patch fixes the issue on my end. >> >> >> >From f6d3fc0de572a1039e83df0389c1c7efce0ef0cf Mon Sep 17 00:00:00 2001 >> From: Visuwesh >> Date: Mon, 11 Dec 2023 17:09:03 +0530 >> Subject: [PATCH] ; Fix shr-put-image with nil value for ALT >> >> [...] >> > Thanks, but can we please avoid running a fixed string through > string-trim? > > Also, I think the fallback on "*" deserves a comment to explain why > that is done. OK, how about the attached instead? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-shr-put-image-with-nil-value-for-ALT.patch >From 27cd2c4c028723009ebf19696825d22c15f59795 Mon Sep 17 00:00:00 2001 From: Visuwesh 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#6774) --- 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..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). + (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 --=-=-=--