fast-xml-parser
Advanced tools
Comparing version 4.0.10 to 4.0.11
Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library. | ||
**4.0.11 / 2022-10-05** | ||
* fix #501: parse for entities only once | ||
**4.0.10 / 2022-09-14** | ||
@@ -4,0 +7,0 @@ * fix broken links in demo site (By [Yannick Lang](https://github.com/layaxx)) |
{ | ||
"name": "fast-xml-parser", | ||
"version": "4.0.10", | ||
"version": "4.0.11", | ||
"description": "Validate XML, Parse XML, Build XML without C/C++ based libraries", | ||
@@ -5,0 +5,0 @@ "main": "./src/fxp.js", |
@@ -23,3 +23,2 @@ 'use strict'; | ||
this.lastEntities = { | ||
"amp" : { regex: /&(amp|#38|#x26);/g, val : "&"}, | ||
"apos" : { regex: /&(apos|#39|#x27);/g, val : "'"}, | ||
@@ -30,2 +29,3 @@ "gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"}, | ||
}; | ||
this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"}; | ||
this.htmlEntities = { | ||
@@ -369,2 +369,3 @@ "space": { regex: /&(nbsp|#160);/g, val: " " }, | ||
const replaceEntitiesValue = function(val){ | ||
if(this.options.processEntities){ | ||
@@ -385,2 +386,3 @@ for(let entityName in this.docTypeEntities){ | ||
} | ||
val = val.replace( this.ampEntity.regex, this.ampEntity.val); | ||
} | ||
@@ -387,0 +389,0 @@ return val; |
@@ -50,2 +50,4 @@ const { buildOptions} = require("./OptionsBuilder"); | ||
throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'") | ||
}else if(value === "&"){ | ||
throw new Error("An entity with value '&' is not permitted"); | ||
}else{ | ||
@@ -52,0 +54,0 @@ this.externalEntities[key] = value; |
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
98422
1863
1
8
20