maddy icon indicating copy to clipboard operation
maddy copied to clipboard

Local image to data URI?

Open fengwang opened this issue 6 years ago • 1 comments

Minimal Code Example

![]( ./images/a.png)

to html5

<img  src="data:image/png;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOy...">

Conditions

If in absolute path or relative path, there exists such an image, generate its data URI instead of providing a link.

Description

convert image to base64 seems a bit annoying, is it possible to implement this feature?

fengwang avatar Jan 23 '19 21:01 fengwang

Adding the functionality to maddy directly would make it necessary to add file handling and image-to-bas64 processing. I actually like libraries which do one thing and one thing only, so I don't feel like this should go directly into maddy. At the moment I am considering making some kind of plugin functionality, so that you could hook into the parsing and replace the image filename yourself.

At the moment the only thing you can do is either replacing it before or after maddy is parsing your markdown files.

progsource avatar Feb 01 '19 03:02 progsource