Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

posthtml-parser

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

posthtml-parser - npm Package Compare versions

Comparing version 0.3.3 to 0.4.0

17

index.js

@@ -28,2 +28,16 @@ 'use strict';

function isDirective(directive, tag) {
if (directive.name instanceof RegExp) {
var regex = RegExp(directive.name.source, 'i');
return regex.test(tag);
}
if (tag !== directive.name) {
return false;
}
return true;
}
function parserDirective(name, data) {

@@ -37,3 +51,4 @@ var directives = [].concat(defaultDirectives, options.directives || []);

if (name.toLowerCase() === directive.name) {
name = name.toLowerCase();
if (isDirective(directive, name)) {
if (!last) {

@@ -40,0 +55,0 @@ results.push(directiveText);

2

package.json
{
"name": "posthtml-parser",
"version": "0.3.3",
"version": "0.4.0",
"description": "Parse HTML/XML to PostHTMLTree",

@@ -5,0 +5,0 @@ "keywords": [

@@ -85,3 +85,3 @@ # posthtml-parser

Default: `[{name: '!doctype', start: '<', end: '>'}]`
Description: *Adds processing of custom directives*
Description: *Adds processing of custom directives. Note: The property ```name``` in custom directives can be ```String``` or ```RegExp``` type*

@@ -88,0 +88,0 @@ ## License

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