Escaping double brackets in imported assets (handlebar engine)



  • I webpacked a huge .js file that turns out to have several {{'s in it. I have it loaded as a resource inside <script> tags and it runs fine with template engine set to 'none', but handlebars will complain.

    I've tried to use {{{{raw}}}} {#asset script.js @encoding=utf8} {{{{/raw}}}}, but it seems that handlebars does not even have that functionality implemented, even though it recommends its use on their own website.

    I guess my last resort would be to go to the big file and replace all {{ with \{{, or use @encode=link, but i'd rather not have to make assets publicly available (sub-question: can I make only certain files public?).
    Is there a better way to achieve my goal of loading that script on a page? Some other way of escaping asset contents?





  • That looks pretty good, thanks. I'll update when I try it out.
    Edit: it works!


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.