Socket
Socket
Sign inDemoInstall

shortcode-tree

Package Overview
Dependencies
0
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.6 to 1.4.7

13

dist/shortcode-parser.js

@@ -229,4 +229,13 @@ "use strict";

readingPropName = false;
readingPropVal = true;
if (nextToken === ShortcodeParser.T_TAG_PROPERTY_SEPARATOR) {
// Value-less property
readingPropName = true;
readingPropVal = false;
currentPropKey = null;
} else {
readingPropName = false;
readingPropVal = true;
}
readingPropValLiteral = false;

@@ -233,0 +242,0 @@ }

2

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

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

@@ -81,2 +81,18 @@ let ShortcodeParser = require('../src').ShortcodeParser;

it('parses a self-closing shortcode with ending integer property', function () {
let testInput = `[image id=123/]`;
let expectedOutput = new Shortcode("image", null, {"id": "123"}, true, testInput);
let actualOutput = ShortcodeParser.parseShortcode(testInput, options) || null;
expect(actualOutput).to.deep.equal(expectedOutput);
});
it('parses a self-closing shortcode with value-less property', function () {
let testInput = `[image zz id=123/]`;
let expectedOutput = new Shortcode("image", null, {"zz": null, "id": "123"}, true, testInput);
let actualOutput = ShortcodeParser.parseShortcode(testInput, options) || null;
expect(actualOutput).to.deep.equal(expectedOutput);
});
it('parses only the first shortcode from a set of sticky shortcodes', function () {

@@ -131,2 +147,10 @@ let testInput = `[b]test[/b] not [i]italics[/i]`;

it('parses a broken self-closing shortcode with ending integer property', function () {
let testInput = `[image id=123]`;
let expectedOutput = new Shortcode("image", null, {"id": "123"}, true, testInput);
let actualOutput = ShortcodeParser.parseShortcode(testInput, options) || null;
expect(actualOutput).to.deep.equal(expectedOutput);
});
it('throws an error for malformatted input: invalid opening tag', function () {

@@ -133,0 +157,0 @@ let testInput = `we [ ] weirdly`;

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc