remark-embed-images-continued

1.1.0-0 • Public • Published

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

Package Sidebar

Install

npm i remark-embed-images-continued

Weekly Downloads

0

Version

1.1.0-0

License

MIT

Unpacked Size

4.02 kB

Total Files

4

Last publish

Collaborators

  • breki