Skip to content

Rewrite image references to their media names on export - #68

Merged
peterbjohnson merged 3 commits into
devfrom
wb/t41
Sep 20, 2026
Merged

peterbjohnson merged 3 commits into
devfrom
wb/t41

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

A field that says is exported unchanged while the file is copied to media/train.png, so Lambda Feedback looks for figures/train.png and shows nothing. Every real export references images by bare basename (question_000_Hydraulic_scale_0001.png, in media/), and the fixture README says so. Both routes have the bug: convert (the filters keep the url as written) and a draft's build (as_set collects references as written).

On export, rewrite every markdown image reference in every field - masterContent, part text, worked solution, answer, area texts, options - to the basename of the file that was copied into media/, and copy the file once under that name; two different files with the same basename get the export's own naming (question_NNN_<Title>_0001.png ...). Load keeps what an export says. Done when a source beside a figures/ folder converts to a set whose JSON references the media/ name and the round-trip test over every export still passes.


Workbench ticket t41.

@peterbjohnson
peterbjohnson merged commit 5f6fe38 into dev Sep 20, 2026
2 of 6 checks passed
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