Closed bpsizemore closed 2 years ago
Wondering if there is existing functionality to take a markdown link like:
![text]('https://site.com/path') ![text]('./some/local/path')
and convert to html like
<img src="data:image/png;base64, ..."> <img src="data:image/png;base64, ...">
I'm trying to convert a markdown file that references images either remote or on the local filesystem and produce a single HTML file that can be loaded anywhere. I don't see any functionality currently that would achieve that, and looking at potentially adding it to the ImageInlineProcessor. https://github.com/Python-Markdown/markdown/blob/9aa4586d92181a07d3c054d81ada9b100c879d68/markdown/inlinepatterns.py#L757
Is this something the markdown project would be open to a PR for? I imagine flag that can be toggled to enable or disable global image encoding into the resulting conversion.
You can try with an extension. Here is one that I wrote: https://facelessuser.github.io/pymdown-extensions/extensions/b64/. If that isn't to your liking, there may be others, or you can write your own.
Wondering if there is existing functionality to take a markdown link like:
and convert to html like
I'm trying to convert a markdown file that references images either remote or on the local filesystem and produce a single HTML file that can be loaded anywhere. I don't see any functionality currently that would achieve that, and looking at potentially adding it to the ImageInlineProcessor. https://github.com/Python-Markdown/markdown/blob/9aa4586d92181a07d3c054d81ada9b100c879d68/markdown/inlinepatterns.py#L757
Is this something the markdown project would be open to a PR for? I imagine flag that can be toggled to enable or disable global image encoding into the resulting conversion.