leshill / handlebars_assets

Use handlebars.js templates with the Rails asset pipeline.
MIT License
649 stars 159 forks source link

HTML is always escaped #94

Closed lukaszswdr closed 10 years ago

lukaszswdr commented 10 years ago

I think HTML is escaped always, even if you surround it with {{{ }}} For example, I have something like this as a content of data array:

<br><br>SomeText<div><a href="google.com">Link</a>

(above is only one element of an array) In template I do something like this:

{{#each data}}
<article>
    <div>{{{content}}}</div>                    
</article>
{{/each}}

As an output I see HTML tags which are simply escaped, why is this happening? (I'm testing it on rails 4)

lukaszswdr commented 10 years ago

Solution is to use:

Handlebars.SafeString