Socket
Socket
Sign inDemoInstall

simple-dom

Package Overview
Dependencies
0
Maintainers
6
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.1.1

46

dist/simple-dom.js

@@ -392,2 +392,17 @@ (function (global, factory) {

var ESC = {
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'&': '&amp;'
};
function matcher(char) {
if (ESC[char] === undefined) {
return char;
}
return ESC[char];
}
function HTMLSerializer(voidMap) {

@@ -418,10 +433,7 @@ this.voidMap = voidMap;

HTMLSerializer.prototype.escapeAttrValue = function(attrValue) {
return attrValue.replace(/[&"]/g, function(match) {
switch(match) {
case '&':
return '&amp;';
case '\"':
return '&quot;';
}
});
if (attrValue.indexOf('&') > -1 || attrValue.indexOf('"') > -1) {
return attrValue.replace(/[&"]/g, matcher);
}
return attrValue;
};

@@ -440,12 +452,10 @@

HTMLSerializer.prototype.escapeText = function(textNodeValue) {
return textNodeValue.replace(/[&<>]/g, function(match) {
switch(match) {
case '&':
return '&amp;';
case '<':
return '&lt;';
case '>':
return '&gt;';
}
});
if (textNodeValue.indexOf('>') > -1 ||
textNodeValue.indexOf('<') > -1 ||
textNodeValue.indexOf('&') > -1
) {
return textNodeValue.replace(/[&<>]/g, matcher);
}
return textNodeValue;
};

@@ -452,0 +462,0 @@

@@ -0,1 +1,16 @@

var ESC = {
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'&': '&amp;'
};
function matcher(char) {
if (ESC[char] === undefined) {
return char;
}
return ESC[char];
}
function HTMLSerializer(voidMap) {

@@ -26,10 +41,7 @@ this.voidMap = voidMap;

HTMLSerializer.prototype.escapeAttrValue = function(attrValue) {
return attrValue.replace(/[&"]/g, function(match) {
switch(match) {
case '&':
return '&amp;';
case '\"':
return '&quot;';
}
});
if (attrValue.indexOf('&') > -1 || attrValue.indexOf('"') > -1) {
return attrValue.replace(/[&"]/g, matcher);
}
return attrValue;
};

@@ -48,12 +60,10 @@

HTMLSerializer.prototype.escapeText = function(textNodeValue) {
return textNodeValue.replace(/[&<>]/g, function(match) {
switch(match) {
case '&':
return '&amp;';
case '<':
return '&lt;';
case '>':
return '&gt;';
}
});
if (textNodeValue.indexOf('>') > -1 ||
textNodeValue.indexOf('<') > -1 ||
textNodeValue.indexOf('&') > -1
) {
return textNodeValue.replace(/[&<>]/g, matcher);
}
return textNodeValue;
};

@@ -60,0 +70,0 @@

{
"name": "simple-dom",
"version": "1.1.0",
"version": "1.1.1",
"description": "A simple JS DOM.",

@@ -15,3 +15,4 @@ "main": "dist/simple-dom.js",

"build": "node bin/build.js",
"test": "testem ci"
"test": "testem ci",
"bench": "npm run build && node ./benches/serialize.js"
},

@@ -31,2 +32,3 @@ "keywords": [

"devDependencies": {
"do-you-even-bench": "^1.0.4",
"qunit-extras": "^3.0.0",

@@ -33,0 +35,0 @@ "qunitjs": "^2.4.0",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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