Implement basic bio formatting. closes flarum/core#203

This commit is contained in:
Toby Zerner 2015-08-04 11:41:47 +09:30
parent 7154558239
commit 82e0f955e8
3 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@
"color-thief": "v2.0",
"mithril": "lhorie/mithril.js#next",
"es6-micro-loader": "caridy/es6-micro-loader#v0.2.1",
"fastclick": "~1.0.6"
"fastclick": "~1.0.6",
"autolink": "*"
}
}

View File

@ -14,6 +14,7 @@ gulp({
bowerDir + '/jquery.hotkeys/jquery.hotkeys.js',
bowerDir + '/color-thief/js/color-thief.js',
bowerDir + '/moment/moment.js',
bowerDir + '/autolink/autolink.js',
bowerDir + '/bootstrap/js/affix.js',
bowerDir + '/bootstrap/js/dropdown.js',

View File

@ -15,7 +15,7 @@ export default class User extends mixin(Model, {
avatarUrl: Model.attribute('avatarUrl'),
bio: Model.attribute('bio'),
bioHtml: computed('bio', bio => bio ? '<p>' + $('<div/>').text(bio).html() + '</p>' : ''),
bioHtml: computed('bio', bio => bio ? '<p>' + $('<div/>').text(bio).html().replace(/\n/g, '<br>').autoLink() + '</p>' : ''),
preferences: Model.attribute('preferences'),
groups: Model.hasMany('groups'),