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 Friday, 7 November 2014 19:55:58 UTC