From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#66457: 30.0.50; shr sometimes displays the same image twice Date: Wed, 11 Oct 2023 09:25:39 +0900 Organization: Emacsen advocacy group Message-ID: 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="22511"; mail-complaints-to="usenet@ciao.gmane.io" To: 66457@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 11 02:27:02 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 1qqN42-0005g4-Jm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Oct 2023 02:27:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqN3i-0007qW-Pm; Tue, 10 Oct 2023 20:26:42 -0400 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 1qqN3h-0007oG-2I for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 20:26:41 -0400 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 1qqN3g-0006DN-Lr for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 20:26:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qqN42-0004eX-40 for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 20:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Katsumi Yamaoka Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Oct 2023 00:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66457 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169698398017826 (code B ref -1); Wed, 11 Oct 2023 00:27:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Oct 2023 00:26:20 +0000 Original-Received: from localhost ([127.0.0.1]:37189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqN3M-0004dS-9Q for submit@debbugs.gnu.org; Tue, 10 Oct 2023 20:26:20 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:41108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqN3J-0004dB-Hq for submit@debbugs.gnu.org; Tue, 10 Oct 2023 20:26:18 -0400 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 1qqN2r-0007Ty-I6 for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 20:25:50 -0400 Original-Received: from mail-pg1-f177.google.com ([209.85.215.177]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qqN2p-0005iV-TK for bug-gnu-emacs@gnu.org; Tue, 10 Oct 2023 20:25:49 -0400 Original-Received: by mail-pg1-f177.google.com with SMTP id 41be03b00d2f7-5859b06509cso4025554a12.2 for ; Tue, 10 Oct 2023 17:25:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696983943; x=1697588743; h=mime-version:organization:subject:to:from:message-id:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wp8zLQQv8aRy1e7xz7/DCwAO5ZBnRs/JS8afWNFV6fE=; b=NOGTWXd0prf3pOPHERIeQ/ow6GbwQmP+lTNELZIlulLN5ZH7JQnwsVwFKVsmHxrXp6 IC5g/2x+NAE3v9/QykqOWeMKluee/afvplYMxYzV0vcqykPlwYoo8k4itRoGq+E7eoEx 4TL9XM8+tnsZ8jyFdatgS+T7Qrp9gt4Y5seMk/BGMEF00e2f0ZYqeRYVqF5o5klPyv1e 0cU2HmgkSnrK8pDo6mGnwWXSdrG21Td0n/cvt919pPC+20EA2WkCJYnwADiPSvH6almT stxeoKbVk3OPUon70/cJPMKXiSvDwPBI/Oqqg6ywL10eOOOAa59FbfOISHy/3JVx4DQ7 uvng== X-Gm-Message-State: AOJu0Yy8AzsBYyvNcr2CZ83CRjTdHbZJd/xtlle+VXqn1lyYQUO5jDvX 0KK7/ZraD0LZER/wrrTLMf/LUNpHEg== X-Google-Smtp-Source: AGHT+IG9/nia5qPMHbsrduR5AloFj2ZGN4q3Z9fTm5M2ZjRYRlhhmElnEfTXjl3HV11xAZNX2sdkQg== X-Received: by 2002:a05:6a20:2446:b0:14c:e8d4:fb3e with SMTP id t6-20020a056a20244600b0014ce8d4fb3emr20408748pzc.43.1696983942554; Tue, 10 Oct 2023 17:25:42 -0700 (PDT) Original-Received: from localhost (157-205-200-190.cns.tayoreru.com. [157.205.200.190]) by smtp.gmail.com with ESMTPSA id v5-20020aa78505000000b00696ca62d5f5sm8842568pfn.8.2023.10.10.17.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 17:25:42 -0700 (PDT) X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Received-SPF: pass client-ip=209.85.215.177; envelope-from=katsumi.yamaoka@gmail.com; helo=mail-pg1-f177.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_TVD_MIME_NO_HEADERS=0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:272238 Archived-At: --=-=-= Hi, If an alt text, that has an `image-displayer' text property, is filled by `shr-fill-line' by way of `shr-fill-lines', the image is displayed for two or more times. It is because the `image-displayer' text property is divided by the newline(s). Here is a quick hack: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- lisp/net/shr.el~ 2023-09-04 23:25:12.472173300 +0000 +++ lisp/net/shr.el 2023-10-11 00:23:43.577152000 +0000 @@ -799,13 +799,17 @@ (when (= (preceding-char) ?\s) (delete-char -1)) (let ((gap-start (point)) - (face (get-text-property (point) 'face))) - ;; Extend the background to the end of the line. + (face (get-text-property (point) 'face)) + (displayer (get-text-property (point) 'image-displayer))) + ;; Extend the background and the image displayer to the end + ;; of the line. (insert ?\n) (shr-indent) (when face (put-text-property gap-start (point) 'face (shr-face-background face))) + (when displayer + (put-text-property gap-start (point) 'image-displayer displayer)) (when (and (> (1- gap-start) (point-min)) (get-text-property (point) 'shr-url) ;; The link on both sides of the newline are the --=-=-=--