strip-markdown

remark plugin to remove markdown formatting

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
strip-markdown
10605.0.02 years ago8 years agoMinified + gzip package size for strip-markdown in KB

Readme

strip-markdown
!Buildbuild-badgebuild !Coveragecoverage-badgecoverage !Downloadsdownloads-badgedownloads !Sizesize-badgesize !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
remarkremark 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 install strip-markdown
## Use

```js
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 remove markdown formatting.
  • Removes html (notegh-19), 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 rehyperehype (hasthast) or user content so there are no openings for cross-site scripting (XSS)xss attacks.

Contribute

See contributing.mdcontributing in remarkjs/.githubhealth for ways to get started. See support.mdsupport for ways to get help.
This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MITlicense © Titus Wormerauthor