Comparing version 5.2.0 to 5.3.0
@@ -9,2 +9,10 @@ # Changelog | ||
# 5.3.0 | ||
* `CHORE`: simplify and speed up entity decoding [`066e712d`](https://github.com/nikku/saxen/commit/066e712dd89f15f913387b40f0198575e1083d2f) | ||
# 5.2.0 | ||
* `CHORE`: properly compile with [Google Closure compiler](https://github.com/google/closure-compiler) | ||
# 5.1.0 | ||
@@ -29,3 +37,3 @@ | ||
* `FEAT`: fully support anonymous elements in namespace mode [`2f48744a`](https://github.com/nikku/saxen/commit/2f48744a077ec096a411d60f3f948903fa53bfc2) | ||
* `FEAT`: emit <warn> for all attribute parse issues [`a5014b25`](https://github.com/nikku/saxen/commit/a5014b257cc4635d55daa2df9d38ce6e3b0da13d) | ||
* `FEAT`: emit `<warn>` for all attribute parse issues [`a5014b25`](https://github.com/nikku/saxen/commit/a5014b257cc4635d55daa2df9d38ce6e3b0da13d) | ||
@@ -93,2 +101,2 @@ ## 3.1.0 | ||
Check `git log` for earlier history. | ||
Check `git log` for earlier history. |
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"main": "./parser.js", | ||
@@ -19,0 +19,0 @@ "bugs": { |
@@ -23,2 +23,7 @@ 'use strict'; | ||
// map UPPERCASE variants of supported special chars | ||
Object.keys(SPECIAL_CHARS_MAPPING).forEach(function(k) { | ||
SPECIAL_CHARS_MAPPING[k.toUpperCase()] = SPECIAL_CHARS_MAPPING[k]; | ||
}); | ||
function error(msg) { | ||
@@ -41,4 +46,2 @@ return new Error(msg); | ||
var _z; | ||
// reserved names, i.e. | ||
@@ -48,13 +51,6 @@ if (z) { | ||
return SPECIAL_CHARS_MAPPING[z]; | ||
} else { | ||
// fall back to original value | ||
return '&' + z + ';'; | ||
} | ||
_z = z.toLowerCase(); | ||
if (hasProperty(SPECIAL_CHARS_MAPPING, _z)) { | ||
return SPECIAL_CHARS_MAPPING[_z]; | ||
} | ||
// return original char, as we don't understand the | ||
// user input | ||
return '&' + z + ';'; | ||
} | ||
@@ -75,5 +71,3 @@ | ||
if (s.length > 3 && s.indexOf('&') !== -1) { | ||
if (s.indexOf('&') !== -1) { | ||
return s.replace(/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig, replaceEntities); | ||
} | ||
return s.replace(/&#(\d+);|&#x([0-9a-f]+);|&(\w+);/ig, replaceEntities); | ||
} | ||
@@ -110,3 +104,5 @@ | ||
function noopGetContext() { return { 'line': 0, 'column': 0 }; } | ||
function noopGetContext() { | ||
return { 'line': 0, 'column': 0 }; | ||
} | ||
@@ -172,3 +168,3 @@ function nullFunc() {} | ||
*/ | ||
var parseStop = false; // прервать парсер | ||
var parseStop = false; | ||
@@ -791,3 +787,3 @@ /** | ||
// проверим что в закрываюшем теге нет лишнего | ||
// verify chars in close tag | ||
for (; q < j; q++) { | ||
@@ -794,0 +790,0 @@ w = xml.charCodeAt(q); |
@@ -14,2 +14,3 @@ # `/saxen/` parser <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5f/Coat_of_arms_of_Saxony.svg/220px-Coat_of_arms_of_Saxony.svg.png" align="right" /> | ||
* tiny (`2.6Kb` minified + gzipped) | ||
* [pretty damn fast](https://github.com/nikku/js-sax-parser-tests) | ||
@@ -16,0 +17,0 @@ |
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
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
30489
143
737