1
votes

I'm trying to return a unicode character from a computed property, but the & keeps getting escaped as &.

I've even tried returning a Handlebars SafeString like so:

return new Ember.Handlebars.SafeString("");

...which produces the same results: 

How can I get this working?

Edit: This is probably related to the fact that I'm using the computed property in the valueBinding of an {{input}} helper. The SafeString method does keep the & from being escaped if I use the value elsewhere.

1

1 Answers

4
votes

I just created a simple jsbin: http://jsbin.com/izurix/5/edit

Basically doing this does not return any &amp for me:

App.ApplicationController = Ember.ObjectController.extend({
  value: "",
  someValue: function() {
    return new Handlebars.SafeString(this.get('value'));
  }.property('value')
});

Furthermore if you don't want that handlebars escapes your string you should use triple-slash {{{someValue}}}.

Hope it helps.