Escaping inlined image between backquotes (as code content) does not prevent its replacement by base64 data
vincent-ferotin opened this issue · 3 comments
When putting text for an inline image (![Alt text](/img/url)
) between backtick quotes (`
), for showing some MarkDown code (see reference), does not prevent image URL replacement by its base64 data counterpart
-- at least for HTML and PDF exports (works well in browser via bs serve
).
Medium via command | Inserted or not |
---|---|
bs serve (in browser) |
ok, :-) |
bs export (dist/HTML) |
ko, :-( |
bs pdf (pdf/PDF) |
ko, :-( |
See #64 for initial prospection and a demonstrating repository:
https://github.com/vincent-ferotin/backslide-imageinpdf
Same behavior seems to occur for background-image, where their URL (url(./img/Image.jpg
), when escaped in a code content, are transformed with base64 data counterparts, when generating both HTML and PDF (works as expected in browser via bs serve
). Of course, when URL does not exist (e.g. url(./img/Sunset....jpg)
), URL is replaced by url(undefined)
and an error is reported when generating output ("0% exporting file 1/2ENOENT: no such file or directory, open '/home/[...]/backslide/testimagepdf/./img/Sunset....jpg'"
).
See previous demo. repo. for demonstration.
Yes, there was many updates to the image replacement regexp and there's some bug that got introduced I think :/
If you're willing to put up a PR to fix it for backticks inclusion, I'll gladly merge it but I don't have time to take a look at it myself anytime soon.
Thanks for the details and repro example BTW, this really helps with issues like this 👍
I'm sorry to not have enough time soon too, to further explore the bug and search for some fix(es) :-(
-- at least for this week! (Perhaps from next week? but could not be sure...)