mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 04:42:55 +08:00
BUGFIX: more robust breakUp helper
This commit is contained in:
parent
e5b4f0f51e
commit
5a238c62eb
|
@ -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));
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user