fast-xml-parser 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library.
2
2
 
3
+ **4.0.4 / 2022-03-03**
4
+ * fix #435: should skip unpaired and self-closing nodes when set as stopnodes
5
+
3
6
  **4.0.3 / 2022-02-15**
4
7
  * fix: ReferenceError when Bundled with Strict (#431) (By [Andreas Heissenberger](https://github.com/aheissenberger))
5
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-xml-parser",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "Validate XML, Parse XML, Build XML without C/C++ based libraries",
5
5
  "main": "./src/fxp.js",
6
6
  "scripts": {
@@ -285,9 +285,13 @@ const parseXml = function(xmlData) {
285
285
  if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { //TODO: namespace
286
286
  let tagContent = "";
287
287
  //self-closing tag
288
- if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){}
288
+ if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
289
+ i = result.closeIndex;
290
+ }
289
291
  //boolean tag
290
- else if(this.options.unpairedTags.indexOf(tagName) !== -1){}
292
+ else if(this.options.unpairedTags.indexOf(tagName) !== -1){
293
+ i = result.closeIndex;
294
+ }
291
295
  //normal tag
292
296
  else{
293
297
  //read until closing tag is found
@@ -312,7 +316,6 @@ const parseXml = function(xmlData) {
312
316
  }else{
313
317
  //selfClosing tag
314
318
  if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
315
-
316
319
  if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
317
320
  tagName = tagName.substr(0, tagName.length - 1);
318
321
  tagExp = tagName;