remark-embed-images-continued
v1.1.0-0
Published
Embed images with data. Forked from original by David Herges, heavily rewitten by Breki Tomasson. Now also embeds media if it was found elsewhere than in your local path.
Downloads
3
Readme
remark-embed-images-continued
Embed images with data: URIs, inlining base64-encoded sources. Based on remark-embed-images, which I felt was too restrictive in that all images needed to have a path that began in either
./
or../
to work. Absolute paths failed, web URL:s failed, etc.
Usage
Input:
![A PNG](./foo.png)
Process:
const embedImage = require('remark-embed-images-continued');
const vfile = require('to-vfile')
const MARKDOWN = vfile.readSync('myfile.md');
remark()
.use(embedImages)
.process(MARKDOWN, function (err, file) {
vfile.writeSync({path: 'myfile_inlined.md', contents: String(file)});
});
Output:
![A PNG](data:image/png;base64,0000...)