tildeio / htmlbars

A variant of Handlebars that emits DOM and allows you to write helpers that manipulate live DOM nodes
MIT License
1.61k stars 193 forks source link

script content #426

Closed g13013 closed 8 years ago

g13013 commented 8 years ago

It seems that HTMLbars tries to parse a script tag content, and issues this error

[Error: Unclosed element `data.length;` (on line 32).] 

When I remove the script tag it compiles without error !

mmun commented 8 years ago

Script tags are not supported. We should improve the error.

stefanpenner commented 8 years ago

We should improve the error.

:+1:

mmun commented 8 years ago

I've created a quest issue #427 for anyone who's interested in fixing this.

g13013 commented 8 years ago

thanks @mmun @stefanpenner, i am interested in fixing it, but i do not understand how htmlbars works internally 😱

g13013 commented 8 years ago

@mmun now that I read the steps i understand that it will not be supported, right ?

mmun commented 8 years ago

@g13013 That's right. It will not be supported. It's not clear what the semantics of "rerendering" a script would be anyways. What does this even mean?

<script>
  console.log("{{message}}");
</script>

I don't even want to think of the script injection potential...

g13013 commented 8 years ago

@mmun I understand the reasons. I think that at least content of <style> and <script> should be ignored and inserted as is. not parsing and, no dynamic value!

anyways, it's not a big deal, but i think that it would be helpful in some cases if htmlbars supports it.