You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(preview): sync sibling assets a single-file deck references (bd-kpuweafo)
`q2 preview deck.qmd` on a bare file (no `_quarto.yml`) runs single-file mode,
which doesn't walk the directory — so `` rendered broken
(the image never reached the VFS; the `<img>` request fell through to the SPA
`index.html`: `naturalWidth 0`, `content-type: text/html`). Project mode works
because the dir-walk syncs the image → automerge → VFS → blob URL.
Match project behavior *for the assets the deck actually references*, without
walking the directory (preserves the `bd-tnm3k` "don't index arbitrary siblings"
property and the VFS-only delivery model — no new disk-serving route):
- quarto-core: `transforms::collect_referenced_asset_urls(blocks)` returns the
relative `Image` URLs a document references (reuses the ResourceCollector
traversal; external/absolute URLs dropped).
- quarto-preview: `config::resolve_single_file_assets` parses the deck and keeps
the referenced relative binary assets that exist and canonicalize *under* the
deck dir (rejects `../` escapes). Injected via `HubConfig.single_file_assets`.
- quarto-hub: `ProjectFiles::with_binary_files`; the single-file branch appends
these so `reconcile_files_with_index` syncs them like project mode.
E2E (`q2 preview page.qmd`, no `_quarto.yml`, sibling image): now a blob URL,
`naturalWidth 320` — identical to project mode. Tests: collect_referenced_asset_
urls (quarto-core), resolve_single_file_assets + `../`-escape guard
(quarto-preview), with_binary_files (quarto-hub). `cargo xtask verify` green.
v1 limits (documented in the plan): load-time resolution only (a reference added
mid-edit needs reload), direct (non-`{{< include >}}`) image references only.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments