GNU bug report logs - #56482
29.0.50; shr displays <![if !supportLists]>...<![endif]> literally instead of dropping the tags

Previous Next

Package: emacs;

Reported by: Justus-dev <at> Piater.name

Date: Sun, 10 Jul 2022 13:16:02 UTC

Severity: normal

Tags: moreinfo, notabug

Found in version 29.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Phil Sainty <psainty <at> orcon.net.nz>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 56482 <at> debbugs.gnu.org, Justus-dev <at> piater.name, Visuwesh <visuweshm <at> gmail.com>
Subject: bug#56482: 29.0.50; shr displays <![if !supportLists]>...<![endif]> literally instead of dropping the tags
Date: Tue, 12 Jul 2022 05:46:54 +1200
On 2022-07-12 01:04, Lars Ingebrigtsen wrote:
> I'm starting to wonder...  is
> <![if !bar]>Foo<![endif]>
> valid syntax?  It's apparently an MSIE-ism:
> https://en.wikipedia.org/wiki/Conditional_comment

Yes, I believe that's invalid, and therefore it's expected
behaviour that it would have a visible effect upon rendering.

So unless HTML5 has legitimised it, it's not really a bug.

I recall encountering this unique-to-MSIE syntax well over
a decade ago at an old job, and establishing a safe way to
get the same outcome without using it, because it wasn't
valid to use.

It's unfortunate that this still exists in the wild.  Now
that MSIE is officially dead, and assuming it's *not* part
of HTML5, it would be nice if things generating that syntax
were updated to not do that.  (Perhaps libxml has dropped
support for it as a result of MSIE reaching end-of-life?)

I think what I came up with at the time was probably the
same thing I can see at that wikipedia link, which is that
instead of writing this:

<![if CONDITION]>
<link href="non-ie.css" rel="stylesheet">
<![endif]>

You instead structure it within valid comments like this:

<!--[if CONDITION]><!-->
<link href="non-ie.css" rel="stylesheet">
<!--<![endif]-->

Difficult to fix at the source if arbitrary people are
sending you this as email, though :(


-Phil





This bug report was last modified 2 years and 313 days ago.

Previous Next


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