Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Inherited a list of "issues" with xmlsitemap from another employee. Top of the list: "no line brakes"
Spelling aside, I guess those PHP_EOL characters are kind of superfluous in an XML document meant for bots.
Will attach a patch that adds a "Remove linebreaks from the sitemap." advanced option.
Comment | File | Size | Author |
---|---|---|---|
#1 | xmlsitemap-remove_linebreaks-1006418-1.patch | 4.91 KB | DanaRoseRoss |
Comments
Comment #1
DanaRoseRoss CreditAttribution: DanaRoseRoss commentedAs promised
Comment #2
Dave ReidI'm not sure why this is even a problem though. Yes, they add one additional character per line, but it makes it much easier for me and users to quickly check out and debug. Patches must be applied to 7.x-2.x-dev first, then backported.
Comment #3
DanaRoseRoss CreditAttribution: DanaRoseRoss commentedYeah, that's why I made it an option. Best I can figure out, there was a problem with one sitemap validator that freaked out over whitespace & linebreaks earlier this year. Probably not an issue anymore, and it's valid XML with or without. I guess you could make the argument it's saving a few pennies on bandwidth.
I'll look into making this a 7.x patch & then backporting next week. It's a slow time for us right now anyway.