From a9d34c3589583c78993a5816cf473aa4096d06ed Mon Sep 17 00:00:00 2001 From: Claus Strasburger Date: Mon, 13 Jan 2014 13:29:19 +0100 Subject: [PATCH] Fix Post-rendering bug Ember.Handlebars.normalizePath was being called with an object as argument which caused it to error out. also wrapped the return in a SafeString, so the html will not get escaped again. --- .../javascripts/discourse/helpers/application_helpers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/helpers/application_helpers.js b/app/assets/javascripts/discourse/helpers/application_helpers.js index 0c2577831..2265f9b6b 100644 --- a/app/assets/javascripts/discourse/helpers/application_helpers.js +++ b/app/assets/javascripts/discourse/helpers/application_helpers.js @@ -7,9 +7,10 @@ Handlebars.registerHelper('breakUp', function(property, hint, options) { var prop = Ember.Handlebars.get(this, property, options); if (!prop) return ""; - hint = Ember.Handlebars.get(this, hint, options); + if (typeof(hint) !== 'string') hint = property; - return Discourse.Formatter.breakUp(prop, hint); + hint = Ember.Handlebars.get(this, hint, options); + return new Handlebars.SafeString(Discourse.Formatter.breakUp(prop, hint)); }); /**