remark-unwrap-images
remark plugin to remove the wrapping paragraph for images
Last updated 7 months ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install remark-unwrap-images 
SYNC missed versions from official npm registry.

remark-unwrap-images

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to remove the wrapping paragraph for images.

Install

npm:

npm install remark-unwrap-images

Use

Say we have the following file, example.md. Imagine section titles and URLs a bit longer though.

![hi](there.png)

And our script, example.js, looks as follows:

var vfile = require('to-vfile')
var remark = require('remark')
var html = require('remark-html')
var unwrapImages = require('remark-unwrap-images')

remark()
  .use(unwrapImages)
  .use(html)
  .process(vfile.readSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

<img src="there.png" alt="hi">

API

remark().use(unwrapImages)

Remove the wrapping paragraph for images. Supports multiple images, white space around images, and images in links as well.

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Compositor and Zeit, Inc.

Current Tags

  • 1.0.0                                ...           latest (7 months ago)

4 Versions

  • 1.0.0                                ...           7 months ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.2-0                                ...           2 years ago

Copyright 2014 - 2016 © taobao.org |