Socket
Socket
Sign inDemoInstall

shortcode-tree

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shortcode-tree - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

2

package.json
{
"name": "shortcode-tree",
"version": "1.2.1",
"version": "1.2.2",
"description": "Parser library for reading short codes (BB codes) into a tree structure",

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

@@ -18,3 +18,3 @@ let ShortcodeParser = require('./shortcode-parser');

// Worse yet, in the case of malformatted shortcodes, this won't work reliably at all. That's a TODO: Figure out how to deal with malformatted input elegantly
const regex = /\[(.*)(\]([\S\s]*)\[\/(.*)\]|\/\])/g;
const regex = /\[(.*)\]/g;

@@ -21,0 +21,0 @@ let match;

@@ -55,3 +55,3 @@ let ShortcodeExtractor = require('./shortcode-extractor');

// Recursive loop: Traverse the child node as well
this.traverseNode(_shortcodeNode);
this.traverseNode(_shortcodeNode, options);
}

@@ -58,0 +58,0 @@

@@ -107,2 +107,16 @@ let ShortcodeTree = require('../src').ShortcodeTree;

});
it ('passes options, and handles self-closing tags with inconsistent syntax correctly', function () {
let testInput = `[vc_column][mk_image src="test.jpg" align="center"][/vc_column]`;
let options = {
selfClosingTags: ["mk_image"]
};
let parsed = ShortcodeTree.parse(testInput, options);
expect(parsed.children.length).to.equal(1);
let columnNode = parsed.children[0];
expect(columnNode.children.length).to.equal(1);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc