nodebb-plugin-github-card
Advanced tools
+4
-2
| (function(module) { | ||
| "use strict"; | ||
| var Card = {}; | ||
| Card.parse = function(postContent, callback) { | ||
| Card.parse = function(data, callback) { | ||
| var re = /\[card:(.*?)(\b|\|(.*?)\*(.*)?)\]/gm; | ||
| var postContent = data.postData.content; | ||
@@ -10,5 +11,6 @@ if (postContent.match(re)) { | ||
| postContent = postContent.replace(re, card); | ||
| data.postData.content = postContent; | ||
| } | ||
| callback(null, postContent); | ||
| callback(null, data); | ||
| }; | ||
@@ -15,0 +17,0 @@ |
+4
-1
| { | ||
| "name": "nodebb-plugin-github-card", | ||
| "version": "0.0.2", | ||
| "version": "0.0.3", | ||
| "description": "NodeBB plugin for github card", | ||
@@ -13,2 +13,5 @@ "main": "index.js", | ||
| }, | ||
| "nbbpm": { | ||
| "compatibility": "^0.7.0" | ||
| }, | ||
| "keywords": [ | ||
@@ -15,0 +18,0 @@ "nodebb", |
+3
-1
@@ -8,3 +8,5 @@ { | ||
| "hooks": [ | ||
| { "hook": "filter:post.parse", "method": "parse", "callbacked": true, "priority": 6 } | ||
| { | ||
| "hook": "filter:parse.post", "method": "parse", "priority": 6 | ||
| } | ||
| ], | ||
@@ -11,0 +13,0 @@ "staticDirs": { |
+6
-4
@@ -0,1 +1,3 @@ | ||
| [Demo](http://swift.tf/topic/94/github-card-plugin) | ||
| # nodebb-plugin-github-card | ||
@@ -12,5 +14,5 @@ | ||
| ``` | ||
| repo card [card:username/repo] | ||
| user card [card:username] | ||
| width * height `[card:username|400*150]` | ||
| ``` | ||
| [card:username/repo] //repo card | ||
| [card:username] //user card | ||
| [card:username|400*150] //width * height ` | ||
| ``` |
11018
1.79%29
16%18
20%