nodebb-plugin-reddit
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -5,11 +5,12 @@ (function(Reddit) { | ||
Reddit.parse = function(postContent, callback) { | ||
Reddit.parse = function(data, callback) { | ||
var regex = /\B(\/[ru]\/\w+)/g; | ||
var postContent = data && data.postData && data.postData.content; | ||
if (postContent.match(regex)) { | ||
postContent = postContent.replace(regex, anchor); | ||
if (postContent && postContent.match(regex)) { | ||
data.postData.content = postContent.replace(regex, anchor); | ||
} | ||
callback(null, postContent); | ||
callback(null, data); | ||
}; | ||
}(module.exports)); |
{ | ||
"name": "nodebb-plugin-reddit", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "NodeBB Reddit Plugin", | ||
@@ -25,3 +25,6 @@ "main": "library.js", | ||
"readme": "", | ||
"readmeFilename": "README.md" | ||
"readmeFilename": "README.md", | ||
"nbbpm": { | ||
"compatibility": "^0.6.0" | ||
} | ||
} |
@@ -8,4 +8,4 @@ { | ||
"hooks": [ | ||
{ "hook": "filter:post.parse", "method": "parse", "priority": 6 } | ||
{ "hook": "filter:parse.post", "method": "parse", "priority": 6 } | ||
] | ||
} | ||
} |
@@ -0,0 +0,0 @@ # NodeBB Reddit Plugin |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30353
22