You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Relative images in GitHub pull request descriptions show "Image unavailable" #27532
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
On GitHub, open a pull request whose description links an image relative to the PR page, for example  where shot.png is committed at that commit.
Check the description on github.com: the image renders.
Open the same pull request in T3 Code's Pull Requests view.
Expected behavior
The image renders, as on github.com. GitHub leaves the destination as written (the body_html from the API keeps src="../blob/<sha>/shot.png?raw=true"), and the browser resolves it against the pull request URL, https://github.com/<owner>/<repo>/pull/<n>, giving https://github.com/<owner>/<repo>/blob/<sha>/shot.png?raw=true. That URL is one gitHubMediaUrl already claims, so on a private repository it should load through the authenticated github-media asset.
Actual behavior
Each image shows "Image unavailable". classifyMarkdownImageSource (packages/client-runtime/src/markdownImages.ts) reads any relative destination as a file in the local checkout, so T3 looks for <checkout>/../blob/<sha>/shot.png on disk. A root-relative destination such as /<owner>/<repo>/blob/<sha>/shot.png is read as a host file the same way. Relative text links in the description break for the same reason.
Pull request descriptions never refer to the reader's filesystem, so they should resolve against the pull request's own URL.
macOS, desktop and web clients, GitHub private repository
Workaround
Write absolute https://github.com/... URLs in the description.
Notes
#24706 adds a resolveRelativeUrl hook on the source control definition, applied to each image and link destination in the web and mobile PR views, and enables it for Forgejo (#18757). GitHub needs the same hook, resolving page-relative and root-relative destinations against the pull request URL.
Activity