benbalter / sitemap-parser

Ruby Gem to parse sitemaps.org compliant sitemaps
MIT License
29 stars 46 forks source link

Spaces in <loc> cause cause Malformed sitemap, no urlset #24

Closed heaven closed 2 years ago

heaven commented 2 years ago

The error is raised if sitemapindex contains an entry where <loc> has spaces around the URL.

Example:

<sitemap>
  <loc> https://www.showtimes.com/MoviesByPopularZip.xml </loc>
  <lastmod>2022-01-14</lastmod>
</sitemap>

Source https://showtimes.com/sitemap.xml

benbalter commented 2 years ago

This should be fixed as of https://github.com/benbalter/sitemap-parser/commit/aeab37a83b5802ac798a895fd8dba8a5b1274532.