Socket
Socket
Sign inDemoInstall

html-entities

Package Overview
Dependencies
0
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.7 to 1.0.8

20

lib/html4-entities.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.4.0
(function() {

@@ -24,3 +24,3 @@ var Html4Entities;

c = htmlCodes[i];
alphaIndex[a] = c;
alphaIndex[a] = String.fromCharCode(c);
numIndex[c] = a;

@@ -35,3 +35,4 @@ i++;

return str.replace(/&(#?[\w\d]+);?/g, function(s, entity) {
var code;
var chr, code;
chr = '';
if (entity.charAt(0) === "#") {

@@ -43,9 +44,14 @@ if (entity.charAt(1).toLowerCase() === 'x') {

}
if (isNaN(code) || code < -32768 || code > 65535) {
chr = '';
} else {
chr = String.fromCharCode(code);
}
} else {
code = alphaIndex[entity] || alphaIndex[entity.toLowerCase()];
chr = alphaIndex[entity];
}
if (code === void 0 || isNaN(code) || code < -32768 || code > 65535) {
return "";
if (chr === void 0) {
return s;
} else {
return String.fromCharCode(code);
return chr;
}

@@ -52,0 +58,0 @@ });

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.4.0
(function() {

@@ -61,3 +61,3 @@ var Html5Entities;

if (char === void 0) {
return "";
return s;
} else {

@@ -64,0 +64,0 @@ return char;

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.4.0
(function() {

@@ -11,21 +11,11 @@

'&lt': '<',
'&LT': '<',
'&gt': '>',
'&GT': '>',
'&quot': '"',
'&QUOT': '"',
'&apos': '\'',
'&APOS': '\'',
'&amp': '&',
'&AMP': '&',
'&lt;': '<',
'&LT;': '<',
'&gt;': '>',
'&GT;': '>',
'&quot;': '"',
'&QUOT;': '"',
'&apos;': '\'',
'&APOS;': '\'',
'&amp;': '&',
'&AMP;': '&'
'&amp;': '&'
};

@@ -78,3 +68,3 @@

} else {
return '';
return s;
}

@@ -81,0 +71,0 @@ }

{
"name": "html-entities",
"version": "1.0.7",
"version": "1.0.8",
"description": "Faster HTML entities encode/decode library.",

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

@@ -55,2 +55,2 @@ node-html-entities

* encodeNonUTF — encodes, replacing characters to its entity representations. Inserts numeric entities for UTF characters.
* decode — decodes, replacing entities to characters. Unknown entities are removed.
* decode — decodes, replacing entities to characters. Unknown entities are left as is.
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