Skip to content

fix: escape URLs in sitemap#164

Closed
pawamoy wants to merge 1 commit into
masterfrom
fix/escape-urls-in-sitemap
Closed

fix: escape URLs in sitemap#164
pawamoy wants to merge 1 commit into
masterfrom
fix/escape-urls-in-sitemap

Conversation

@pawamoy

@pawamoy pawamoy commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Issue zensical/zensical#772.

Example sitemap after this change:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      <url>
        <loc>http:&#x2f;&#x2f;localhost:8000&#x2f;</loc>
      </url>
      <url>
        <loc>http:&#x2f;&#x2f;localhost:8000&#x2f;markdown&#x2f;</loc>
      </url>
      <url>
        <loc>http:&#x2f;&#x2f;localhost:8000&#x2f;test&amp;test&#x2f;test&#x2f;</loc>
      </url>
</urlset>

This fixes the instant preview in the mentioned issue.

Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
@squidfunk

Copy link
Copy Markdown
Member

Superseded by zensical/zensical#773. MkDocs uses percent-encoding in URLs, which is the canonical way to normalize URLs, and we were just missing the percent-encoding of & characters.

@squidfunk squidfunk closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants