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

HTMLBars not respecting Ember.String.htmlSafe() #452

Closed spinlock99 closed 8 years ago

spinlock99 commented 8 years ago

If I bind to the variable message in a template:

//template.hbs
{{message}}

//component.js
message: "line one<br>line two"

message will be escaped and the <br> tag will not cause a line break. However, if the variable is a SafeString, it is still escaped:

//component.js
message: Ember.String.htmlSafe("line one<br>line two")
rwjblue commented 8 years ago

Could you please provide a demo/reproduction?

spinlock99 commented 8 years ago

OK, I'm an idiot. I was trying to compose multiple htmlSafe strings and pass that as message. If I compose the string then call htmlSafe it works.

Thanks.