ITADN

Inline data URI images can fail to render in Markdown/HTML cells

#163Closedjvican 创建于 2026-05-06
J
jvicancommented
Images embedded as `data:image/png;base64,...` URIs can fail to render when their base64 payload contains certain trailing `/` characters. The issue happens because Euporie routes image `src` values through URL/path normalization before loading them. For `data:` URIs, that normalization can modify the base64 string, corrupting the image data before it reaches the image loader. This shows up as warnings like: > Error loading data:image/png;base64,... or later image decode failures such as: * **Incorrect padding** * **Could not load image** ### Expected behavior Inline `data:` images should load exactly as embedded, without modifying the base64 payload. ### Actual behavior Some inline `data:` images are corrupted during URL handling and fail to render. ### Suggested fix Handle `data:` URIs separately in the HTML asset loader. Decode them directly, and only use normal base URL joining / fsspec loading for non-data URLs. ### Test case Add a regression test with an `<img src="data:image/png;base64,...">` payload that ends in `/` characters, and assert that the decoded bytes are loaded unchanged. I have a potential pull request I can send if needed.
关闭于 2026-05-08 2 条评论