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

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

From: Ian Hickson <ian@hixie.ch>
Date: Fri, 7 Nov 2014 19:55:34 +0000 (UTC)
To: Jesse McCarthy <whatwg-2010-04@jessemccarthy.net>
Message-ID: <alpine.DEB.2.00.1411071954120.7063@ps20323.dreamhostps.com>
Cc: whatwg@whatwg.org
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 Friday, 7 November 2014 19:55:58 UTC

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