posthtml-parser
Advanced tools
Comparing version 0.3.0 to 0.3.1
14
index.js
@@ -5,2 +5,3 @@ 'use strict'; | ||
var isObject = require('isobject'); | ||
var objectAssign = require('object-assign'); | ||
@@ -48,2 +49,13 @@ /** | ||
function normalizeArributes(attrs) { | ||
var result = {}; | ||
Object.keys(attrs).forEach(function(key) { | ||
var obj = {}; | ||
obj[key] = attrs[key].replace(/"/g, '"'); | ||
objectAssign(result, obj); | ||
}); | ||
return result; | ||
} | ||
var parser = new htmlparser.Parser({ | ||
@@ -67,3 +79,3 @@ onprocessinginstruction: parserDirective, | ||
if (Object.keys(attrs).length) { | ||
buf.attrs = attrs; | ||
buf.attrs = normalizeArributes(attrs); | ||
} | ||
@@ -70,0 +82,0 @@ |
{ | ||
"name": "posthtml-parser", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Parse HTML/XML to PostHTMLTree", | ||
@@ -28,4 +28,5 @@ "keywords": [ | ||
"dependencies": { | ||
"htmlparser2": "^3.8.3", | ||
"isobject": "^2.1.0" | ||
"htmlparser2": "^3.9.2", | ||
"isobject": "^2.1.0", | ||
"object-assign": "^4.1.1" | ||
}, | ||
@@ -32,0 +33,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1
25861
3
8
107
+ Addedobject-assign@^4.1.1
+ Addedobject-assign@4.1.1(transitive)
Updatedhtmlparser2@^3.9.2