fast-xml-parser
Advanced tools
Comparing version 4.3.6 to 4.4.0
Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library. | ||
**4.4.0 / 2024-05-18** | ||
* fix #654: parse attribute list correctly for self closing stop node. | ||
* fix: validator bug when closing tag is not opened. (#647) (By [Ryosuke Fukatani](https://github.com/RyosukeFukatani)) | ||
* fix #581: typings; return type of `tagValueProcessor` & `attributeValueProcessor` (#582) (By [monholm]()) | ||
**4.3.6 / 2024-03-16** | ||
@@ -4,0 +9,0 @@ * Add support for parsing HTML numeric entities (#645) (By [Jonas Schade ](https://github.com/DerZade)) |
{ | ||
"name": "fast-xml-parser", | ||
"version": "4.3.6", | ||
"version": "4.4.0", | ||
"description": "Validate XML, Parse XML, Build XML without C/C++ based libraries", | ||
@@ -5,0 +5,0 @@ "main": "./src/fxp.js", |
@@ -348,3 +348,3 @@ type X2jOptions = { | ||
*/ | ||
tagValueProcessor?: (name: string, value: unknown) => string; | ||
tagValueProcessor?: (name: string, value: unknown) => unknown; | ||
@@ -362,3 +362,3 @@ /** | ||
*/ | ||
attributeValueProcessor?: (name: string, value: unknown) => string; | ||
attributeValueProcessor?: (name: string, value: unknown) => unknown; | ||
@@ -365,0 +365,0 @@ /** |
@@ -106,2 +106,4 @@ 'use strict'; | ||
return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); | ||
} else if (tags.length === 0) { | ||
return getErrorObject('InvalidTag', "Closing tag '"+tagName+"' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); | ||
} else { | ||
@@ -108,0 +110,0 @@ const otg = tags.pop(); |
@@ -314,2 +314,9 @@ 'use strict'; | ||
if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){ | ||
if(tagName[tagName.length - 1] === "/"){ //remove trailing '/' | ||
tagName = tagName.substr(0, tagName.length - 1); | ||
jPath = jPath.substr(0, jPath.length - 1); | ||
tagExp = tagName; | ||
}else{ | ||
tagExp = tagExp.substr(0, tagExp.length - 1); | ||
} | ||
i = result.closeIndex; | ||
@@ -319,2 +326,3 @@ } | ||
else if(this.options.unpairedTags.indexOf(tagName) !== -1){ | ||
i = result.closeIndex; | ||
@@ -321,0 +329,0 @@ } |
168849
3908