mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +08:00
Trim hyphens from start/end of slug
This commit is contained in:
parent
c35b472e66
commit
3362a8c092
|
@ -23,7 +23,7 @@ export default Subject.extend(HasItemLists, {
|
|||
|
||||
title: DS.attr('string'),
|
||||
slug: Ember.computed('title', function() {
|
||||
return this.get('title').toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-');
|
||||
return this.get('title').toLowerCase().replace(/[^a-z0-9]/gi, '-').replace(/-+/g, '-').replace(/-$|^-/g, '');
|
||||
}),
|
||||
|
||||
startTime: DS.attr('date'),
|
||||
|
|
Loading…
Reference in New Issue
Block a user