Socket
Socket
Sign inDemoInstall

htmljs-parser

Package Overview
Dependencies
Maintainers
5
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmljs-parser - npm Package Compare versions

Comparing version 2.8.0 to 2.8.1

test/autotest/default-attr-comma/expected.html

1

notify-util.js

@@ -135,2 +135,3 @@ exports.createNotifiers = function(parser, listeners) {

var newAttr = {
default: attr.default,
name: attr.name,

@@ -137,0 +138,0 @@ value: attr.value,

2

package.json

@@ -41,3 +41,3 @@ {

},
"version": "2.8.0"
"version": "2.8.1"
}

@@ -5,9 +5,20 @@ 'use strict';

function attributesToString(attributes, includeLiteralValues) {
if (!attributes || attributes.length === 0) {
var len = attributes && attributes.length || 0;
if (!len) {
return '';
}
return ' ' + attributes.map(function(attr) {
var result = attr.name;
var i = 0;
var result = "";
var attr = attributes[0];
if (attr.default) {
i = 1;
result = attributeAssignmentToString(attr, includeLiteralValues);
}
for (;i < len; i++) {
attr = attributes[i];
result += " " + attr.name;
if (attr.argument) {

@@ -17,16 +28,24 @@ result += '(' + attr.argument.value + ')';

if (attr.value) {
result += '=' + attr.value;
} else if (!attr.argument) {
result += '=(EMPTY)';
}
result += attributeAssignmentToString(attr, includeLiteralValues);
}
if (includeLiteralValues) {
result += '[Literal: ' + (attr.hasOwnProperty('literalValue') ? JSON.stringify(attr.literalValue) : '(empty)') + ']';
}
return result;
// return '[' + result + ']';
}).join(' ');
return result;
}
function attributeAssignmentToString(attr, includeLiteralValues) {
var result = "";
if (attr.value) {
result += '=' + attr.value;
} else if (!attr.argument) {
result += '=(EMPTY)';
}
if (includeLiteralValues) {
result += '[Literal: ' + (attr.hasOwnProperty('literalValue') ? JSON.stringify(attr.literalValue) : '(empty)') + ']';
}
return result;
}
class RootNode {

@@ -33,0 +52,0 @@ constructor() {

Sorry, the diff of this file is too big to display

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