Skip to content

feat: inline local images during publish#3

Open
Restuta wants to merge 1 commit intomainfrom
feat/inline-image-publishing
Open

feat: inline local images during publish#3
Restuta wants to merge 1 commit intomainfrom
feat/inline-image-publishing

Conversation

@Restuta
Copy link
Owner

@Restuta Restuta commented Mar 24, 2026

Summary

  • add a render-only markdown path so the CLI can resolve local assets without losing the original source markdown
  • inline local image assets as data URLs when publishing from a file path
  • support both Obsidian image embeds like ![[diagram.svg|320x200]] and standard markdown image syntax with local relative paths
  • keep ?raw=1 returning the original vault markdown, not the transformed render snapshot
  • allow data: image sources through the sanitize step so embedded images survive rendering
  • add unit and CLI integration coverage for the image publish flow

Why

Today local image embeds publish poorly because the renderer has no access to the source file system and strips non-standard Obsidian syntax down to dead text. This change makes file-based publishing portable without introducing a full asset store yet.

Verification

  • npm run verify
  • browser-tested on a local pubmd server by publishing a note with ![[diagram.svg|320x200]] through the real CLI and verifying the rendered page contained an actual <img> with a data:image/svg+xml;base64,... source while ?raw=1 still returned the original embed syntax

@vercel
Copy link

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
publish-it Ready Ready Preview, Comment Mar 24, 2026 6:39am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant