Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): ensure sitemap & url are arrays #158

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

chowson
Copy link
Contributor

@chowson chowson commented Nov 11, 2024

Issue

  • When only 1 <sitemap> or url node, fast-xml-parser does not create an array. This breaks when trying to iterate over the sites node.

Fix

  • Added an option to the parser to force these nodes to be an array, even when only 1 element in the XML.

@chowson chowson force-pushed the master branch 2 times, most recently from 5731827 to a8d28e8 Compare November 11, 2024 11:07
@chowson
Copy link
Contributor Author

chowson commented Nov 11, 2024

@seantomburke Not sure why one of the tests is failing, I couldn't get the test to run when cloning with no changes.

Hope the change makes sense.

@saitho
Copy link

saitho commented Nov 28, 2024

Works well for me. Without this change I can't use the latest version. :)

@seantomburke seantomburke reopened this Dec 20, 2024
@seantomburke seantomburke merged commit e68945b into seantomburke:master Dec 20, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants