Closed romanbsd closed 9 years ago
@romanbsd I don't think this behaviour should have changed... Can you give me a better idea of your setup?
This is the template that stopped working:
{{#link class="push-right"}}
{{name}}
{{/link}}
This is the link helper:
(function(hbs) {
hbs.registerHelper('link', function(options) {
var attrs = [], opts = options.hash || {};
opts.href = this.url;
for (var prop in opts) {
attrs.push(prop + '="' + opts[prop] + '"');
}
return new hbs.SafeString('<a ' + attrs.join(' ') + '>' + options.fn(this) + '</a>');
});
})(Handlebars);
@romanbsd had some time and looked into this a little more; this is a bug in handlebars itself cause if the template is more than just the return of the safe string; it will return a regular JS string...
See http://jsfiddle.net/9D88g/28/ ; and check your JS console and you will see how it is just handlebars...
Are you going to open a ticket on the handlebars bug tracker or you want me to? btw, what did change in handlebars_assets that caused this bug to appear?
@romanbsd I updated the handlebars version which caused the error, this is a regression bug. I thought I told you to post on Handlebars (but maybe I did? I don't remember).
I'm using handlebars with Marionette/Backbone. Since the version 0.17 the template returns a Handlebars' SafeString rather than JS String, which is quite unfortunate, as jQuery chokes on it. Locked the version to 0.16 for now.