New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nodebb-plugin-github-card

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodebb-plugin-github-card - npm Package Compare versions

Comparing version
0.0.1
to
0.0.2
+6
-21
index.js

@@ -5,24 +5,9 @@ (function(module) {

Card.parse = function(postContent, callback) {
var re = /\[card.*?\]/gm;
var arr = postContent.match(re);
if(arr && arr.length == 1){
var config = arr[0];
config = config.replace(']', '');
arr = config.split(':');
if(arr.length == 2){
arr = arr[1].split('|');
var cardInfo = arr[0];
var width = 400;
var height = 150;
if(arr.length == 2){
arr = arr[1].split('*');
if(arr.length == 2){
width = arr[0];
height = arr[1];
}
}
var card = '<div class="github-card" data-github="'+cardInfo+'" data-width="'+width+'" data-height="'+height+'"></div><script src="/plugins/nodebb-plugin-github-card/static/widget.js"></script>'
postContent = postContent.replace(re, card);
}
var re = /\[card:(.*?)(\b|\|(.*?)\*(.*)?)\]/gm;
if (postContent.match(re)) {
var card = '<div class="github-card" data-github="$1" data-width="$3" data-height="$4"></div><script src="/plugins/nodebb-plugin-github-card/static/widget.js"></script>'
postContent = postContent.replace(re, card);
}
callback(null, postContent);

@@ -29,0 +14,0 @@ };

{
"name": "nodebb-plugin-github-card",
"version": "0.0.1",
"version": "0.0.2",
"description": "NodeBB plugin for github card",

@@ -5,0 +5,0 @@ "main": "index.js",