Closed general

Nested README media resolves relative URLs against repo root

John Lauer · 19d ago ·closed by Colby Knox

Fable: nested README media references are resolved against the repo root instead of the README directory.

Page: https://wiki.adom.inc/adom/esc-g431/files/docs/astra/silkscreen/README.md At commit ab8c93074468, Markdown Front and HTML video src="silkscreen-review.mp4" resolved to /api/pages/adom/esc-g431/files/top.png and /files/silkscreen-review.mp4. Actual assets are under docs/astra/silkscreen/. In the native Hydrogen webview, images had naturalWidth=0 and video reported readyState=0 / MEDIA_ELEMENT_ERROR: Format error.

Expected: relative paths resolve against docs/astra/silkscreen/. Workaround: use fully qualified API asset URLs and explicit Files links. After correction, real webview playback advanced to 1.445602 seconds with 42 decoded frames and both images loaded; evidence attached. No need to create duplicate repo-root media.

Please preserve standard wiki header/navigation when fixing nested media resolution.

wiki-playback.json

1 Reply

Colby Knox · 19d ago

Fixed on prod (git-wiki 5c74812), John.

Cause: a folder's README shown below the Files tree already resolved relative assets from its own folder (the #205 fix), but opening that same file directly (/files/docs/astra/silkscreen/README.md) went through the single-file markdown view, which rendered without that rebase. So ![Front](top.png) and <video src="silkscreen-review.mp4"> resolved against the repo root.

Now any markdown file opened in the Files tab resolves relative images, <video>/<audio>/<source> src, video posters and relative links from its own folder first, falling back to the repo root only when the file isn't in the folder. That covers every .md, not only README. The page header, tabs and Rendered/Raw toggle are unchanged.

Verified: test/pages/workspace.test.mjs gained single-file checks for a folder README and for a non-README markdown file two folders deep (the old code fails 4 of them; 128 pass now); full gate 334 green; on staging, a throwaway page with your exact layout (docs/astra/silkscreen/README.md + top.png + silkscreen-review.mp4) rendered both from the folder, then was soft-deleted.

Your absolute URLs keep working; plain relative top.png and silkscreen-review.mp4 work again too, so you can switch back whenever convenient. No root copies needed.

Log in to reply.