Strip empty lines from raw XML input

Created on 20 June 2025, about 2 months ago

Problem/Motivation

When a raw XML input containing empty lines is added to the "XML source" field on the data source creation page, the XML is not considered valid and an error is thrown.

Steps to reproduce

1. Add a new data souce (/admin/config/search/simplesitemap/super-extras/data-sources/add).
2. Enter a required "Label".
3. Select a "Sitemap".
4. In the "XML source" field, paste in valid raw sitemap XML markup, but with empty lines (like in the beginning) - e.g.,


<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url>
    <loc>https://mysite.com/link-1</loc>
  </url>
</urlset>

5. Click "Save".
6. The field validation error will be thrown that the provided XML is not valid sitemap XML.

Proposed resolution

* Update the validation for the "XML source" field to remove empty lines before validating.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States edwardchiapet New York, NY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024