Repository navigation
fix: render raw HTML images in generated documents - #19
Conversation
|
Thanks for this. The approach is the right one — routing HTML images through I ran the branch here: 238 tests pass, ruff check and format are clean. I also threw awkward input at it — images inside headings and table cells, One thing before I merge: the README documents what the converter handles, and this needs a line there. The "Supported Markdown Elements" checklist, and the conversion table above it where For the record: building this repo's README with your branch now embeds the four GIFs, which is the point, and the shields.io badges fall back to their alt text exactly like remote Markdown images already do. Both are what I want. |
|
Addressed in 8bfc35c: added raw HTML |
Raw HTML
<img>tags were discarded by both HTML renderers, so their images never reached the PDF. Parse image attributes with the standard-library HTMLParser and route them through the existing Markdown image registration and placement methods.Fixes #18.
This preserves asset deduplication, escaped alt fallback, and opt-in remote fetching. The change handles block/inline images and images inside HTML wrappers; it does not add general HTML/CSS rendering or honor image sizing attributes.
Validation:
python -m doc_engine buildfrom Markdown containing block and inline HTML images. PDF image inventory shows both placements, and the rendered page was visually checked.Nine regressions cover embedding, surrounding text, ordering/deduplication with Markdown, attribute case/quotes/entities, missing-source alt fallback, remote-fetch opt-in with a stub, comments/script content, and existing br behavior. No remote image requests were made. AI-assisted implementation and verification.