Nominating Presidential Muppets
Have ideas to improve npm?Join in the discussion! »

strip-markdown
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

strip-markdown

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin remove Markdown formatting. This essentially removes everything but paragraphs and text nodes.

This is one of the first remark plugins, before prefixing with remark- got cool.

Note!

This plugin is ready for the new parser in remark (remarkjs/remark#536). No change is needed: it works exactly the same now as it did before!

Install

npm:

npm install strip-markdown

Use

var remark = require('remark')
var strip = require('strip-markdown')
 
remark()
  .use(strip)
  .process('Some *emphasis*, **importance**, and `code`.', function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Yields:

Some emphasis, importance, and code.

API

remark().use(strip)

Plugin remove Markdown formatting.

  • Removes html (note), code, horizontalRule, table, yaml, toml, and their content
  • Render everything else as simple paragraphs without formatting
  • Uses alt text for images

Security

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

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 strip-markdown

DownloadsWeekly Downloads

21,145

Version

4.0.0

License

MIT

Unpacked Size

10.4 kB

Total Files

5

Last publish

Collaborators

  • avatar
  • avatar