Resolve README URLs through OrgSwift for Markdown too !9

merged merged by cmc on 2026-09-01 03:07 UTC · krz/hutch:markdown-shared-resolver into main

Discussion

cmc

ReadmeView carried its own resolveRepositoryLinkURL / resolveRepositoryAssetURL / normalizeRepositoryPath — the ancestors of the ones OrgSwift 0.6.0 exposes as OrgRenderOptions.resolvedLinkURL / resolvedImageURL. Both README formats now resolve through one implementation rather than two that can drift.

Relative links in a Markdown README already worked; this removes the duplicate and fixes two things it carried:

  • The local copy hardcoded git.sr.ht, so a self-hosted instance was reached by string-replacing the host out of a finished URL. That would also rewrite a path segment that happened to read git.sr.ht. The options carry the host, and a test covers it.
  • Markdown targets now pass the same scheme allowlist Org ones do, so a data: image in a .md README is dropped — consistent with the WebView allow-list hardening that already dropped data:.

-109 lines in ReadmeView.swift. Full suite green, 30 tests in that file.