From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#40532: 28.0.50; eww/shr: Anchor link does not work Date: Tue, 19 May 2020 14:23:46 +0200 Message-ID: <87k118ru3x.fsf@gnus.org> References: <87sghckn7p.fsf@milkypond.org> <87o8rk597f.fsf@milkypond.org> <87blnj92dy.fsf@tcd.ie> <87imhr65p2.fsf@tcd.ie> <878sijpqr0.fsf@milkypond.org> <87y2qjxqbu.fsf@tcd.ie> <87d07p4npz.fsf@gnus.org> <87zhatxojk.fsf@tcd.ie> <87h7wrkz9x.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="39611"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 40532@debbugs.gnu.org, Arnaud Fontaine To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 19 14:24:14 2020 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 1jb1I3-000A5o-Ny for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 May 2020 14:24:11 +0200 Original-Received: from localhost ([::1]:40294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb1I2-0007ST-Qj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 May 2020 08:24:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51450) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb1Hu-0007Qq-P1 for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 08:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37962) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb1Hu-0002kN-Fk for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 08:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jb1Hu-0007NO-AW for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 08:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2020 12:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40532-submit@debbugs.gnu.org id=B40532.158989104028346 (code B ref 40532); Tue, 19 May 2020 12:24:02 +0000 Original-Received: (at 40532) by debbugs.gnu.org; 19 May 2020 12:24:00 +0000 Original-Received: from localhost ([127.0.0.1]:49508 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb1Hs-0007N8-Ft for submit@debbugs.gnu.org; Tue, 19 May 2020 08:24:00 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:54156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb1Hq-0007Mv-Qa for 40532@debbugs.gnu.org; Tue, 19 May 2020 08:23:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AV2z6tppB8Ul+dpahOJESPa6GVbfcIvNGYS6xE8Z5Kc=; b=ni8siH7yetSMQZBasDJmCaft+y 0TuYD7HzKXXCOWZCecrrbTjD/dOICQq1e0SYcwWXrSDc4bRHXacJwh+sAVwgoqY1wySKDMkdxm8++ E21SvemhPNGjb11kqnUwL/FmoPxRO9FjWED+cqBC4r0fj7r57O85ht9wDecN/ZvL9/Qc=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jb1Hf-0000SN-7T; Tue, 19 May 2020 14:23:51 +0200 In-Reply-To: <87h7wrkz9x.fsf@tcd.ie> (Basil L. Contovounesios's message of "Fri, 08 May 2020 02:10:02 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:180584 Archived-At: "Basil L. Contovounesios" writes: > OTOH if the shr-target-id property is always attached to the relevant > 'id' and (deprecated) 'name' attributes, then cached table contents will > still be searchable. This shouldn't be overkill in terms of performance > because yet another text property on a subet of the DOM should be > comparatively cheap, right? > > So WDYT of the following fix? Can you think of any better solutions? The patch is a bit hard to read, because it seems to have a lot of unrelated changes like: > -(require 'shr) > -(require 'url) > -(require 'url-queue) > -(require 'thingatpt) > (require 'mm-url) > (require 'puny) > -(eval-when-compile (require 'subr-x)) ;; for string-trim > +(require 'shr) > +(require 'text-property-search) > +(require 'thingatpt) > +(require 'url) > +(require 'url-queue) > +(eval-when-compile (require 'subr-x)) and > - (when (and shr-target-id > - (equal (dom-attr dom 'name) shr-target-id)) > - ;; We have a zero-length element, so just > - ;; insert... something. > + (when-let* ((id (or (dom-attr dom 'id) > + ;; Obsolete since HTML5. > + (dom-attr dom 'name)))) > + ;; We have an empty element, so just insert... something. and > - (insert "*")) > - (put-text-property start (1+ start) 'shr-target-id shr-target-id)) > + (insert ?*) > + (put-text-property (1- (point)) (point) 'display "")) > + (put-text-property start (1+ start) 'shr-target-id id)) so I can't really make out what the changes you're making in this area is... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no