W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2014

Re: [whatwg] <script> content restrictions vis-a-vis HTML template data blocks

From: Jesse McCarthy <whatwg-2010-04@jessemccarthy.net>
Date: Mon, 10 Nov 2014 14:53:13 -0500
Message-ID: <9A29706E847744728264F7062CDD4743@Computer>
To: "Ian Hickson" <ian@hixie.ch>
Cc: whatwg@whatwg.org
> Have you considered using the <template> element?

Thanks for the suggestion. Right now I'm just concerned with the mechanics 
of script data blocks.

> These are all conforming; don't forget that the empty string is a string 
> so "outer" matches the empty string.

Ah, ok, thanks, I didn't realize that. I interpreted "any string" to mean 
any non-empty string. I suggest that it would be helpful to clarify that.

I think it'd be good to modify that note at the beginning of section 
4.12.1.2 to make it clear that it's not generally necessary to escape "<!--" 
in script data blocks containing HTML / XML -- so long as "<!--" occurs in 
sequences matching the comments syntax (12.1.6). Mention <template> and / or 
HTML Imports as well if you wish.

Thanks,
Jesse

----- Original Message ----- 
From: "Ian Hickson" <ian@hixie.ch>
To: "Jesse McCarthy" <whatwg-2010-04@jessemccarthy.net>
Cc: <whatwg@whatwg.org>
Sent: Friday, November 07, 2014 2:55 PM
Subject: Re: [whatwg] <script> content restrictions vis-a-vis HTML template 
data blocks


> On Wed, 5 Nov 2014, Jesse McCarthy wrote:
>>
>> Re: the "Restrictions for contents of script elements" (4.12.1.2):
>>
>> Consider <script> elements containing data blocks. It's useful to embed
>> templates in these; HTML templates for example. When embedding HTML 
>> templates,
>> it would be onerous to have to either omit comments or implement an 
>> escaping /
>> unescaping regimen.
>
> Have you considered using the <template> element?
>
>
>> The following examples illustrate my interpretation of the requirements 
>> for
>> <script> content. Is this correct?
>>
>> Non-conforming (does not match the "outer" production before 
>> "comment-open" /
>> after "comment-close" / or both):
>>
>> <script type="text/plain"><!-- a --></script>
>>
>> <script type="text/plain">
>> <!-- a --></script>
>>
>> <script type="text/plain"><!-- a -->
>> </script>
>
> These are all conforming; don't forget that the empty string is a string
> so "outer" matches the empty string.
>
> -- 
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.' 
Received on Monday, 10 November 2014 20:48:47 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:32 UTC