Skip to content

fix(w3c/headers): show version URLs as readable IRIs - #5378

Draft
marcoscaceres wants to merge 1 commit into
mainfrom
fix/4910-header-iri-display
Draft

fix(w3c/headers): show version URLs as readable IRIs#5378
marcoscaceres wants to merge 1 commit into
mainfrom
fix/4910-header-iri-display

Conversation

@marcoscaceres

Copy link
Copy Markdown
Contributor

Closes #4910

The version links in the header now show the human-readable IRI as link text while the href keeps the percent-encoded URL, so a spec with non-ASCII characters in its URL reads normally. Applies to all five of the version URLs in that list, not just latestVersion: thisVersion, edDraftURI, historyURI and prevVersion had the same problem on adjacent lines. Malformed escape sequences are left as-is rather than throwing.

Written with AI: this change was generated by Claude, and the regression test was proven to fail without the fix. Per AI_POLICY.md.

Copilot AI lite review requested due to automatic review settings August 5, 2026 06:18
@marcoscaceres marcoscaceres added the AI Contains AI-generated logic; see AI_POLICY.md label Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the W3C header “version links” rendering so that link text displays a human-readable IRI (decoded when possible), while the link href preserves the percent-encoded URL. This addresses specs whose URLs contain non‑ASCII characters without breaking the actual target URL, and avoids throwing on malformed escape sequences.

Changes:

  • Update W3C headers template to decode version URL strings for display text only (thisVersion, latestVersion, edDraftURI, historyURI, prevVersion).
  • Add a safeDecodeURI() helper that falls back to the original string when decoding fails.
  • Add regression tests covering readable IRI display, malformed escape sequences, and additional version URLs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/spec/w3c/headers-spec.js Adds coverage ensuring displayed link text is decoded IRI while href remains encoded, including malformed-escape fallback.
src/w3c/templates/headers.js Uses decoded IRI strings for link text across the version links, keeping existing href values intact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Contains AI-generated logic; see AI_POLICY.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

latestVersion URLencodes IRIs making them unreadable by people

2 participants