Skip to content

Node.js based forum software built for the modern web

parse post in Topics.reply not in Posts.create

barisusakli712bd3938fd2
diff --git a/src/posts.js b/src/posts.js
index 762f7bf4fc..9e3877d55e 100644
--- a/src/posts.js
+++ b/src/posts.js
@@ -96,17 +96,8 @@ var async = require('async'),
});
},
function(postData, next) {
- postTools.parse(postData.content, function(err, content) {
- if (err) {
- return next(err);
- }
-
- plugins.fireHook('action:post.save', postData);
-
- postData.content = content;
-
- next(null, postData);
- });
+ plugins.fireHook('action:post.save', postData);
+ next(null, postData);
}
], callback);
};
diff --git a/src/topics/create.js b/src/topics/create.js
index fc7033bfc7..2b0d8bcf5b 100644
--- a/src/topics/create.js
+++ b/src/topics/create.js
@@ -237,6 +237,9 @@ module.exports = function(Topics) {
},
postIndex: function(next) {
posts.getPidIndex(postData.pid, uid, next);
+ },
+ content: function(next) {
+ postTools.parse(postData.content, next);
}
}, next);
},
@@ -244,6 +247,7 @@ module.exports = function(Topics) {
postData.user = results.userInfo[0];
results.topicInfo.title = validator.escape(results.topicInfo.title);
postData.topic = results.topicInfo;
+ postData.content = results.content;
if (results.settings.followTopicsOnReply) {
threadTools.follow(postData.tid, uid);