GNU bug report logs - #30546
27.0.50; shr: span tag with href attribute

Previous Next

Package: emacs;

Reported by: Katsumi Yamaoka <yamaoka <at> jpl.org>

Date: Tue, 20 Feb 2018 09:54:02 UTC

Severity: minor

Tags: patch

Found in version 27.0.50

Done: Katsumi Yamaoka <yamaoka <at> jpl.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Katsumi Yamaoka <yamaoka <at> jpl.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#30546: closed (27.0.50; shr: span tag with href attribute)
Date: Wed, 21 Feb 2018 09:22:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 21 Feb 2018 18:21:06 +0900
with message-id <b4mzi42y9z1.fsf <at> jpl.org>
and subject line Re: bug#30546: 27.0.50; shr: span tag with href attribute
has caused the debbugs.gnu.org bug report #30546,
regarding 27.0.50; shr: span tag with href attribute
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
30546: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30546
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: bug-gnu-emacs <at> gnu.org
Cc: jidanni <at> jidanni.org
Subject: 27.0.50; shr: span tag with href attribute
Date: Tue, 20 Feb 2018 18:52:37 +0900
[Message part 3 (text/plain, inline)]
Hi,

Though it is not necessarily a bug[1], Firefox renders this as
a link but shr doesn't:

<span href="https://www.example.com" style="font-size:...">Foo</span>

Jidanni wrote me that some html mails he receives contain such
forms, and I tried making shr support it as the patch attached
below.  I'm not quite sure whether it causes a trouble but I'm
going to try it for some time.

Thanks.

[1] <https://stackoverflow.com/questions/46889226/is-a-span-tag-with-a-href-attribute-considered-valid>

[Message part 4 (text/x-patch, inline)]
--- shr.el~	2018-01-15 21:54:49.635451500 +0000
+++ shr.el	2018-02-20 09:47:39.198990800 +0000
@@ -1751,3 +1751,5 @@
 (defun shr-tag-span (dom)
-  (shr-generic dom))
+  (if (dom-attr dom 'href)
+      (shr-tag-a (cons 'a (cdr dom)))
+    (shr-generic dom)))
 
[Message part 5 (message/rfc822, inline)]
From: Katsumi Yamaoka <yamaoka <at> jpl.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 30546-done <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#30546: 27.0.50; shr: span tag with href attribute
Date: Wed, 21 Feb 2018 18:21:06 +0900
On Wed, 21 Feb 2018 09:56:16 +0100, Lars Ingebrigtsen wrote:
> The email in question had the structure

> <a href=...><table>...<span href=...></a>

> So Firefox treats the entire table as a link.  The span href seems to be
> ignored.

I realized that the url values of <a href=...> and <span href=...>
are the same.  I tried changing the value of <span href=...> and
verified Firefox doesn't use it as a separate link.  Thank you for
investigating it.  I'm closing this bug.

Regards,


This bug report was last modified 7 years and 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.