Resolve relative links in a Markdown README !44

merged merged by cmc on 2026-09-01 00:33 UTC · krz/gitbay-ios:markdown-relative-links into main

Discussion

cmc

Closes #11.

AttributedString(markdown:) sets .link to the raw target, so [ARCHITECTURE.md](ARCHITECTURE.md) became a scheme-less URL that openURL cannot open — the text rendered blue and the tap did nothing.

MarkdownView now takes the same OrgRenderOptions ReadmeView already builds for the org path and rewrites relative targets through OrgSwift's resolver (krz/org-swift!8), so a relative link in a Markdown README reaches the same file page an org one does. Bodies with no file to be relative to — issues, merge requests, releases — pass no options and are unchanged.

Verified in the simulator on krz/org-swift: "See ARCHITECTURE.md." now opens gitbay.org/krz/org-swift/blob/HEAD/ARCHITECTURE.md. Full suite green, including three new cases over path, ./path, ../path, /abs/path, and the no-options passthrough.