shortcode-tree
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"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); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59793
1066