mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
parse category description closes #3209
This commit is contained in:
@@ -166,15 +166,22 @@ var async = require('async'),
|
||||
category.topic_count = category.totalTopicCount = category.topic_count || 0;
|
||||
}
|
||||
|
||||
if (category.description) {
|
||||
category.description = validator.escape(category.description);
|
||||
}
|
||||
|
||||
if (category.image) {
|
||||
category.backgroundImage = category.image;
|
||||
}
|
||||
|
||||
callback(null, category);
|
||||
if (category.description) {
|
||||
plugins.fireHook('filter:parse.raw', category.description, function(err, parsedDescription) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
category.descriptionParsed = parsedDescription;
|
||||
category.description = validator.escape(category.description);
|
||||
callback(null, category);
|
||||
});
|
||||
} else {
|
||||
callback(null, category);
|
||||
}
|
||||
}
|
||||
|
||||
Categories.getCategoryField = function(cid, field, callback) {
|
||||
|
||||
Reference in New Issue
Block a user