diff --git a/install/data/categories.json b/install/data/categories.json index a86ff24e7c..58ac6e8d40 100644 --- a/install/data/categories.json +++ b/install/data/categories.json @@ -2,6 +2,7 @@ { "name": "Announcements", "description": "Announcements regarding our community", + "descriptionParsed": "

Announcements regarding our community

\n", "bgColor": "#fda34b", "color": "#fff", "icon" : "fa-bullhorn", @@ -10,6 +11,7 @@ { "name": "General Discussion", "description": "A place to talk about whatever you want", + "descriptionParsed": "

A place to talk about whatever you want

\n", "bgColor": "#59b3d0", "color": "#fff", "icon" : "fa-comments-o", @@ -18,6 +20,7 @@ { "name": "Blogs", "description": "Blog posts from individual members", + "descriptionParsed": "

Blog posts from individual members

\n", "bgColor": "#86ba4b", "color": "#fff", "icon" : "fa-newspaper-o", @@ -26,6 +29,7 @@ { "name": "Comments & Feedback", "description": "Got a question? Ask away!", + "descriptionParsed": "

Got a question? Ask away!

\n", "bgColor": "#e95c5a", "color": "#fff", "icon" : "fa-question", diff --git a/src/categories/create.js b/src/categories/create.js index f80e78f24e..6e13d8689d 100644 --- a/src/categories/create.js +++ b/src/categories/create.js @@ -28,6 +28,7 @@ module.exports = function(Categories) { cid: cid, name: data.name, description: data.description ? data.description : '', + descriptionParsed: data.descriptionParsed ? data.descriptionParsed : '', icon: data.icon ? data.icon : '', bgColor: data.bgColor || colours[0], color: data.color || colours[1], @@ -52,7 +53,12 @@ module.exports = function(Categories) { async.series([ async.apply(db.setObject, 'category:' + category.cid, category), - async.apply(Categories.parseDescription, category.cid, category.description), + function (next) { + if (category.descriptionParsed) { + return next(); + } + Categories.parseDescription(category.cid, category.description, next); + }, async.apply(db.sortedSetAdd, 'categories:cid', category.order, category.cid), async.apply(db.sortedSetAdd, 'cid:' + parentCid + ':children', category.order, category.cid), async.apply(privileges.categories.give, defaultPrivileges, category.cid, 'administrators'),