From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenjiro NAKAYAMA Newsgroups: gmane.emacs.bugs Subject: bug#16285: 24.3.50; [PATCH] shr: handle tag with blank error. Date: Sun, 29 Dec 2013 22:08:04 +0900 Message-ID: <877ganst3f.fsf@dhcp-193-97.nrt.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388322558 7878 80.91.229.3 (29 Dec 2013 13:09:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 29 Dec 2013 13:09:18 +0000 (UTC) To: 16285@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 29 14:09:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VxG7O-0003nv-BQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 14:09:22 +0100 Original-Received: from localhost ([::1]:55187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxG7N-0000jl-Q1 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Dec 2013 08:09:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxG7D-0000U2-9l for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2013 08:09:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxG74-0002Bc-SU for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2013 08:09:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxG74-0002BX-Ok for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2013 08:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VxG74-00086D-BL for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2013 08:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kenjiro NAKAYAMA Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Dec 2013 13:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16285 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138832252631106 (code B ref -1); Sun, 29 Dec 2013 13:09:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Dec 2013 13:08:46 +0000 Original-Received: from localhost ([127.0.0.1]:50030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VxG6n-00085d-69 for submit@debbugs.gnu.org; Sun, 29 Dec 2013 08:08:45 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58840) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VxG6m-00085Q-0b for submit@debbugs.gnu.org; Sun, 29 Dec 2013 08:08:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxG6d-00028v-AI for submit@debbugs.gnu.org; Sun, 29 Dec 2013 08:08:43 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxG6d-00028q-7D for submit@debbugs.gnu.org; Sun, 29 Dec 2013 08:08:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxG6U-0000QY-Jx for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2013 08:08:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VxG6M-00025z-0L for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2013 08:08:26 -0500 Original-Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:40336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxG6L-00025s-PD for bug-gnu-emacs@gnu.org; Sun, 29 Dec 2013 08:08:17 -0500 Original-Received: by mail-pa0-f53.google.com with SMTP id hz1so10747057pad.40 for ; Sun, 29 Dec 2013 05:08:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:from:to:subject:date:message-id:mime-version :content-type; bh=XwX97kDlu6xWYEhVlwZCxU3LXLDu5BkNMdxr6AYidnk=; b=BgrMvQ6YNHyWcP1t18aaX5EltuDGrcymib0/mhqZLt3FpjutIlw+5o4ZQp0TZ9uGqf kQUwZCiHReYbwoeUU4wNtyziXoTQF8Qm8FTjBh4WUsrd56KJg73/QVtmV8cGFCZ01Kg2 g5y+ON8Cjylf7xfdjt8mqERE5eIwZgtmwPsxycvzgaPmk8Iqvitkuiv8HBhOHAlhXJxF Pkqx45gR51trbjMYmUsbj+n/NWCoIvBxtskj8NVWIK82wVuCSYa/jMkUe21z3JGvWqPa EYq5g9ZlUygeyWZZR7JlcQqttcDH//XoW6t5mgn6h2sqgpVRx2E7p/mpavn7rTaXf/6T fWdw== X-Received: by 10.68.139.228 with SMTP id rb4mr61831599pbb.15.1388322495983; Sun, 29 Dec 2013 05:08:15 -0800 (PST) Original-Received: from dhcp-193-97.nrt.redhat.com (nat-pool-nrt-t1.redhat.com. [66.187.238.10]) by mx.google.com with ESMTPSA id vf7sm74854262pbc.5.2013.12.29.05.08.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Dec 2013 05:08:14 -0800 (PST) User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.2 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82703 Archived-At: If there is tag with blank, the internal link will fail. Please reproduce the bug by following HTML. (Internal link "section1" can not jump to internal link.) I am not sure following patch is the best fix. Please review and install it to the official tree if appreciated. ~~~~~~~~~~~~~~~ INTERNAL LINK TEST
  • section1

  • --- TEST ---
    link test ~~~~~~~~~~~~~~~ Signed-off-by: Kenjiro NAKAYAMA * net/eww.el (shr-descend): Handle tag with blank error. --- lisp/net/shr.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 1604ebb..20dd31f 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -380,7 +380,11 @@ size, and full-buffer size." (shr-generic (cdr dom))) (when (and shr-target-id (equal (cdr (assq :id (cdr dom))) shr-target-id)) - (put-text-property start (1+ start) 'shr-target-id shr-target-id)) + (let ((result (ignore-errors + (put-text-property start (1+ start) 'shr-target-id shr-target-id) + t))) + (unless result + (put-text-property start (1- start) 'shr-target-id shr-target-id)))) ;; If style is set, then this node has set the color. (when style (shr-colorize-region start (point) -- 1.8.3.1