Wondering what’s next for npm?Check out our public roadmap! »

remark-strip-badges

5.0.0 • Public • Published

remark-strip-badges

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to strip badges (such as shields.io).

Note!

This plugin is ready for the new parser in remark (remarkjs/remark#536). The current and previous versions of the plugin work with the current and previous versions of remark.

Install

npm:

npm install remark-strip-badges

Use

Say we have the following file, example.md:

remark-strip-badges ![Build Status][badge]
 
[badge]: https://img.shields.io/travis/remarkjs/remark-strip-badges.svg

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

var fs = require('fs')
var remark = require('remark')
var strip = require('remark-strip-badges')
 
remark()
  .use(strip)
  .process(fs.readFileSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

remark-strip-badges
 
[badge]: https://img.shields.io/travis/remarkjs/remark-strip-badges.svg

API

remark.use(stripBadges)

Plugin to strip badges (such as shields.io).

Security

Use of remark-strip-badges does not involve rehype (hast) or user content so there are no openings for cross-site scripting (XSS) attacks.

Related

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, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Install

npm i remark-strip-badges

DownloadsWeekly Downloads

46

Version

5.0.0

License

MIT

Unpacked Size

8.07 kB

Total Files

4

Last publish

Collaborators

  • avatar
  • avatar