Reputation: 3989
This is highly simplified, but I have something like the following:
<img src="www.example.com/image.jpg" {{bindAttr alt="view.altText"}} />
The altText
binding comes from a computed property in the view which returns an HTML character like T
, but then either Ember or Handlebars (not sure) escapes it for output and what I end up seeing in the code is &#x54;
which displays in the browser as, literally "T" instead of the proper HTML character.
In the computed property, I tried return new Handlebars.SafeString( 'T' )
, but that just threw an error about expecting a string, not an object.
So how do I prevent this?
Update: Here's a github issue on the matter. Currently no additional info, but it may get updated before this thread does.
Upvotes: 4
Views: 663
Reputation: 1980
Handlebars escapes values between {{ }} use {{{ }}} to show output unescaped strings.
Source: http://handlebarsjs.com/
Upvotes: 4