Expose repository-relative URL resolution !8

merged merged by cmc on 2026-09-01 00:28 UTC · krz/org-swift:relative-link-resolution into main

Discussion

cmc

A README is not always org. gitbay-ios renders a Markdown README through its own view, which has no way to resolve a relative link, so [x](ARCHITECTURE.md) renders styled as a link and does nothing when tapped. Ref krz/gitbay-ios#11.

OrgRenderOptions.resolvedLinkURL(_:) / resolvedImageURL(_:) make the existing resolution public, so the Markdown path resolves the same targets the same way instead of growing a second implementation of path normalization, percent encoding, and the scheme allowlist.

Also: the sanitizer no longer HTML-escapes its return value. It returns a URL, and URL(string:) on an & gets the wrong query — which the native org renderer has been doing for any link with a query string. The HTML renderer now escapes at the two points it writes an attribute.

91 tests green, conformance unchanged.