W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2010

[whatwg] Allowing ">" in attribute values

From: Kornel Lesinski <kornel@geekhood.net>
Date: Thu, 24 Jun 2010 16:04:22 +0100
Message-ID: <091CE42E-DE50-4320-9A61-D6C968E92CC6@geekhood.net>
On 24 Jun 2010, at 14:11, Benjamin M. Schwartz wrote:

>> Why would it simplify parsing?
> 
> It greatly simplifies parsing when you just want to extract entire tags,
> without immediately parsing the attributes.

If you mean "parsing" with regular expressions, then I think that's a bad practice and shouldn't be encouraged. 

Also take into consideration that even if ">" was forbidden in the spec, it wouldn't mean it doesn't happen in the wild. Since it works in browsers, you'd still have to support it if you wanted to parse markup from the web. OTOH if you want to parse only markup that is under your control, you can self-impose that restriction.

However, I see other argument against allowing ">" in attributes: it helps to catch unclosed attributes early:

<a href="foo>

-- 
regards, Kornel
Received on Thursday, 24 June 2010 08:04:22 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:24 UTC