feat(image): support local Markdown image embeds - #357
Open
ELEVENBLACK41 wants to merge 1 commit into
Open
ELEVENBLACK41 wants to merge 1 commit into
ELEVENBLACK41 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Summary / 摘要
Add secure local image rendering for standard Markdown images and Obsidian-style image embeds in the Electron demo.
为 Electron Demo 增加本地 Markdown 图片和 Obsidian 图片嵌入的安全渲染能力
Motivation / 背景与动机
I regularly use Obsidian to write and manage Markdown notes. After running Nexus Editor and opening one of my local Obsidian Vaults, I found that common Obsidian image embeds such as
![[Pasted image.png]]were displayed as unresolved references instead of rendered images.Before this change, local image references were treated as ordinary renderer-relative URLs, so images stored in Vault attachment folders could not be displayed. This exposed a compatibility gap between Nexus Editor's live preview and Obsidian-style Markdown syntax.
This change resolves local images relative to the active Markdown file, falls back to a unique matching image basename inside the current Vault, and loads the final bytes through the scoped
nexus-vault://resource protocol without exposing absolute filesystem paths.add-local-image-embedsChanges / 变更内容
packages/core:![[image.png]]![[image.png|width]]packages/plugin-*:apps/electron-demo:nexus-vault://resource loading for legacy and runtime modesopenspec/:add-local-image-embedsproposal, design, tasks, and specTesting / 测试
pnpm typecheckpnpm buildpnpm --filter @floatboat/nexus-electron-demo buildpnpm testpasses / 全绿 fail与本次改动无关Full test result: 900/911 tests passed. The remaining failures are environment-dependent Windows symlink permission tests and one performance-baseline test. No image-related test failures were observed.
Manual verification target:
apps/electron-demo/sample-vaultas a Vault.image-demo.md.and![[img/1.png]].Pasted image.pngunder an attachment folder.![[img/1.png|280]]renders with the requested width.Compliance / 合规自检
AI-assisted notes:
AI tools were used for repository exploration, design discussion, implementation assistance, test scaffolding, and review. I reviewed the final changes and can explain the path-resolution rules, Vault security boundaries, resource lifecycle, and test coverage.
.env/ personal Vault data committedChecklist / 自检清单
live-preview-table.tswas not touched; table-specific rules are not applicableadd-local-image-embedsScreenshots / Recordings · 截图或录屏