unified

Project: remarkjs/remark-squeeze-paragraphs

Package: remark-squeeze-paragraphs@4.0.0

  1. Dependencies: 0·Dependents: 35
  2. remark plugin to remove empty paragraphs
  1. remark 188
  2. unified 165
  3. markdown 132
  4. plugin 128
  5. mdast 88
  6. remark-plugin 70
  7. remove 10
  8. clean 6
  9. whitespace 6
  10. paragraph 4
  11. empty 3
  12. squeeze 3

remark-squeeze-paragraphs

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to remove empty (or whitespace only) paragraphs.

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 previously!

Install

npm:

npm install remark-squeeze-paragraphs

Use

var remark = require('remark')
var stripBadges = require('remark-strip-badges')
var squeezeParagraphs = require('remark-squeeze-paragraphs')

remark()
  .use(stripBadges)
  .processSync('![](https://img.shields.io/)\n\ntext')
  .toString()
// => "\n\ntext\n"

remark()
  .use(stripBadges)
  .use(squeezeParagraphs)
  .processSync('![](https://img.shields.io/)\n\ntext')
  .toString()
// => "text\n"

API

remark().use(squeezeParagraphs)

Remove empty (or white-space only) paragraphs.

Security

Use of remark-squeeze-paragraphs 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 © Eugene Sharygin