Re: [whatwg] script content restrictions vis-a-vis HTML template data blocks
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 i...@hixie.ch To: Jesse McCarthy whatwg-2010...@jessemccarthy.net Cc: wha...@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. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] script content restrictions vis-a-vis HTML template data blocks
Also, look up HTML imports using LINK element. Works well with scoped stylesheets. Thanks for the suggestion. Right now I'm just concerned with the mechanics of script data blocks, but like template, HTML imports is also a useful tool. Thanks, Jesse - Original Message - From: Garrett Smith dhtmlkitc...@gmail.com To: Ian Hickson i...@hixie.ch Cc: Jesse McCarthy whatwg-2010...@jessemccarthy.net; wha...@whatwg.org Sent: Friday, November 07, 2014 3:52 PM Subject: Re: [whatwg] script content restrictions vis-a-vis HTML template data blocks On 11/7/14, Ian Hickson i...@hixie.ch wrote: 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? Also, look up HTML imports using LINK element. Works well with scoped stylesheets. -- Garrett @xkit ChordCycles.com garretts.github.io
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. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] script content restrictions vis-a-vis HTML template data blocks
On 11/7/14, Ian Hickson i...@hixie.ch wrote: 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? Also, look up HTML imports using LINK element. Works well with scoped stylesheets. -- Garrett @xkit ChordCycles.com garretts.github.io
[whatwg] script content restrictions vis-a-vis HTML template data blocks
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. The specification suggests 'to always escape !-- as \!--', which isn't too bad for JavaScript, but would be a hassle for HTML templates. 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 Conforming (newline characters satisfy the outer production in both positions): script type=text/plain !-- a -- /script Conforming (space characters satisfy the outer production in both positions): script type=text/plain !-- a -- /script