Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escaping inlined image between backquotes (as code content) does not prevent its replacement by base64 data #66

Open
vincent-ferotin opened this issue Oct 12, 2019 · 3 comments

Comments

@vincent-ferotin
Copy link
Contributor

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

@vincent-ferotin
Copy link
Contributor Author

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.

@sinedied
Copy link
Owner

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 👍

@vincent-ferotin
Copy link
Contributor Author

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...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants