Skip to content

feat(markdown): emit asset:N hrefs for embedded images - #70

Open
alexiskowalski wants to merge 13 commits into
firecrawl:mainfrom
alexiskowalski:feat/markdown-asset-refs-63
Open

feat(markdown): emit asset:N hrefs for embedded images#70
alexiskowalski wants to merge 13 commits into
firecrawl:mainfrom
alexiskowalski:feat/markdown-asset-refs-63

Conversation

@alexiskowalski

Copy link
Copy Markdown

Summary

Fixes #63: embedded assets already appear as Inline::Image { source: Asset(id) } in the document model, but Markdown dropped them to alt text only (or nothing when alt was empty), so to_markdown_bytes() lost positional image markers.

Changes

  • Render ImageSource::Asset as ![alt](asset:N), where N is the index into Document.assets.
  • Keep ImageSource::Unavailable as alt-text-only (no bytes to reference).
  • Document the asset:N scheme in the README.
  • Update Markdown snapshots that previously collapsed embedded images to bare alt text.

Callers can rewrite asset:N after writing asset files out, or keep using the document model for the bytes. This is complementary to approaches that inject resolved URLs.

Test plan

  • Unit tests for asset href rendering (with and without alt).
  • Snapshot updates for docx/odt/rtf/doc/epub fixtures that embed pictures.
  • cargo test --locked render::markdown
  • cargo test --locked --test snapshots
  • CI

f1vwpbleiia7ie added 13 commits August 8, 2026 22:55
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
Signed-off-by: f1vwpbleiia7ie <f1vwpbleiia7ie@users.noreply.github.com>
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.

Expose embedded image assets in markdown output

1 participant