linkedin / dustjs

Asynchronous Javascript templating for the browser and server
http://dustjs.com
MIT License
2.91k stars 479 forks source link

[Question] Possible to force the parser / compiler to process a block as a literal without parsing it's content? #345

Closed ovaillancourt closed 11 years ago

ovaillancourt commented 11 years ago

We happen to have to compile a template that contains smarty template tags (see example below) provided by a third party, which conflict with the dustjs tags. Is there a way to have the dustjs parser and compiler completely ignore a block of content in a template?

ie: a tag or pragma that would say "ignore the content of that section, just render it as-is"?

(I'm aware that we can resolve the issue in different ways such as providing the faulty content through the context and disabling escaping, but I'm curious as to whether dust has such feature built-in.)

Example of template content that we'd like to be parsed as a raw literal by the parser (notice the {literal} tags conflicting):

 <script type="text/javascript">/*{literal}<![CDATA[*/
content here
  /*]]>{/literal}*/</script>

Thanks!

jimmyhchan commented 11 years ago

There is a pull request to do just that

ovaillancourt commented 11 years ago

Oh wow, completely missed that one! Thanks for the pointer.

For other people's reference: #334