mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
BUGFIX: more robust breakUp helper
This commit is contained in:
@ -7,9 +7,12 @@
|
||||
Handlebars.registerHelper('breakUp', function(property, hint, options) {
|
||||
var prop = Ember.Handlebars.get(this, property, options);
|
||||
if (!prop) return "";
|
||||
if (typeof(hint) !== 'string') hint = property;
|
||||
if (typeof(hint) === 'string') {
|
||||
hint = Ember.Handlebars.get(this, hint, options);
|
||||
} else {
|
||||
hint = undefined;
|
||||
}
|
||||
|
||||
hint = Ember.Handlebars.get(this, hint, options);
|
||||
return new Handlebars.SafeString(Discourse.Formatter.breakUp(prop, hint));
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user