fix(markdown): preview local/relative images in .md files - #292
Merged
Menghuan1918 merged 2 commits intoAug 23, 2026
Conversation
The shared MarkdownText only renders absolute http(s) images (relative links are disabled for chat security), so a local image referenced by a previewed markdown file - , an absolute /cwd/img.png, or a reference definition - showed only its alt text. Rewrite such destinations into absolute /sidebar/file media URLs (with the GUI origin prefix) so MarkdownText accepts them and the host media route serves the bytes (still restricted to the session cwd). The rewriter is a dependency-free pure helper (markdown-images.ts) with a focused unit spec; TextEditor passes the rewritten preview text to both the plain MarkdownText and the mermaid-lazy preview.
Menghuan1918
added a commit
that referenced
this pull request
Aug 24, 2026
- README / README_EN: add v0.16.0 changelog (free windows #354, model-driven sidebar opens #353, Markdown inline HTML + TOC #360, 19-language overlays #339, multi-repo git + linked worktrees #326/#285, browser loopback allowlist, Vue + 28 legacy languages #202, preview refresh trio #215/#228, local Markdown images #292, ego-browser catalog #340; fixes: market/cordis #338, ctx.get() reads #357, workspace boundary #345, panel-host layering #330/#278, layout-push hardening #310/#130/#180, width sharing #36, terminal cleanup #130, fs-search noise dirs #342, mermaid #341, Nerd Font #190, UTF-8 HTML #193, trust-fence #182, reveal-in-explorer #94, PowerShell #47, GET probe fallback #69, unrun devDep #336) and move v0.15.2 into history - feature tour: free windows + Markdown inline HTML/TOC (EN), feature list - plugin ecosystem: add ego-browser (24 tab plugins), install pin ^0.16.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shared MarkdownText only renders absolute http(s) images (relative links are disabled for chat security), so a local image referenced by a previewed markdown file -
, an absolute /cwd/img.png, or a reference definition - showed only its alt text.
Rewrite such destinations into absolute /sidebar/file media URLs (with the GUI origin prefix) so MarkdownText accepts them and the host media route serves the bytes (still restricted to the session cwd). The rewriter is a dependency-free pure helper (markdown-images.ts) with a focused unit spec; TextEditor passes the rewritten preview text to both the plain MarkdownText and the mermaid-lazy preview.