Files
hapi/web/src
eb49ccd62b fix(web): resolve relative Markdown links and images in file preview (#2211)
* fix(web): resolve relative Markdown links and images in file preview

The standalone Markdown preview rendered without the previewed file's path,
so relative .md links became inert and relative images resolved against the
web page URL. Pass the session file to the renderer and resolve relative
hrefs/srcs against its directory: links open the sibling file preview,
images load through the session file-read API. HTTPS images are unchanged
(direct browser load); paths that escape the root stay inert.

Fixes #1917

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): bound preview image reads and check workspace containment

Only read supported image types whose directory-listed size is at most
10 MiB, and require absolute resolved paths to stay inside the session
workspace so escapes remain inert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(web): keep session links and browsing context in Markdown preview

Resolve session references before relative file paths, and carry the
preview's origin/tab/query into relative file links so Back returns to
where the user entered from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 10:31:28 +08:00
..
…