unified

Project: remarkjs/strip-markdown

Package: strip-markdown@5.0.0

  1. Dependents: 0
  2. remark plugin to remove markdown formatting
  1. remark 208
  2. unified 174
  3. markdown 156
  4. plugin 137
  5. mdast 87
  6. remark-plugin 76
  7. text 18
  8. plain 4

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

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install strip-markdown

Use

import {remark} from 'remark'
import strip from 'strip-markdown'

remark()
  .use(strip)
  .process('Some *emphasis*, **importance**, and `code`.')
  .then((file) => {
    console.log(String(file))
  })

Yields:

Some emphasis, importance, and code.

API

This package exports no identifiers. The default export is stripMarkdown.

unified().use(stripMarkdown[, options])

Plugin to remove markdown formatting.

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