[solved] Plugin not work
-
I use NodeBB v0.7.0dev
plugin.json:{ "id": "nodebb-plugin-test", "name": "Plugin name", "url": "url to github", "library": "./index.js", "hooks": [ { "hook": "filter:post.parse" , "method": "parse" , "callbacked": true } ] }
index.js:
(function(Preparsed) { 'use strict' var async = module.parent.require('async'), db = module.parent.require('./database'); Preparsed.parse = function(postContent, callback) { postContent = postContent.replace(/123/g, "check") callback(null, postContent) } }(module.exports))
package.json:
{ "name": "nodebb-plugin-test", "version": "1.0.0", "description": "Description plugin", "main": "index.js", "author": "I'm <[email protected]>", "license": "MIT", "dependencies": { "express": "^4.12.0", "passport-http-bearer": "^1.0.1" }, "nbbpm": { "compatibility": "^0.6.0" } }
I create topic. Topic name: 123123123, Content: 123 123 123
123 should be replaced by check, but nothing happens.Please, tell me, what is wrong?
-
it's
filter:parse.post
, notfilter:post.parse
-
All is well! I helped @psychobunny https://github.com/NodeBB/NodeBB/issues/2869#event-255546006
Copyright © 2024 NodeBB | Contributors