Skip to content

Commit

Permalink
fix(parser): ensure sitemap & url are arrays (#158)
Browse files Browse the repository at this point in the history
* fix(parser): ensure sitemap & url are arrays

* 3.2.20

---------

Co-authored-by: chris-howson-metagenics <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
3 people authored Dec 20, 2024
1 parent af2d0dd commit e68945b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sitemapper",
"version": "3.2.19",
"version": "3.2.20",
"description": "Parser for XML Sitemaps to be used with Robots.txt and web crawlers",
"keywords": [
"parse",
Expand Down
5 changes: 4 additions & 1 deletion src/assets/sitemapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,10 @@ export default class Sitemapper {
}

// Parse XML using fast-xml-parser
const parser = new XMLParser();
const parser = new XMLParser({
isArray: (tagName) =>
['sitemap', 'url'].some((value) => value === tagName),
});

const data = parser.parse(responseBody.toString());

Expand Down

0 comments on commit e68945b

Please sign in to comment.