Skip to content

Node.js based forum software built for the modern web

closes #4916

barisusaklibb05e6e39322
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": "<p>Announcements regarding our community</p>\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": "<p>A place to talk about whatever you want</p>\n",
"bgColor": "#59b3d0",
"color": "#fff",
"icon" : "fa-comments-o",
@@ -18,6 +20,7 @@
{
"name": "Blogs",
"description": "Blog posts from individual members",
+ "descriptionParsed": "<p>Blog posts from individual members</p>\n",
"bgColor": "#86ba4b",
"color": "#fff",
"icon" : "fa-newspaper-o",
@@ -26,6 +29,7 @@
{
"name": "Comments & Feedback",
"description": "Got a question? Ask away!",
+ "descriptionParsed": "<p>Got a question? Ask away!</p>\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'),