Socket
Socket
Sign inDemoInstall

remark-squeeze-paragraphs

Package Overview
Dependencies
15
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remark-squeeze-paragraphs

remark plugin to remove empty paragraphs


Version published
Maintainers
2
Install size
312 kB
Created

Readme

Source

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

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

npm:

npm install remark-squeeze-paragraphs

Use

import {remark} from 'remark'
import remarkStripBadges from 'remark-strip-badges'
import remarkSqueezeParagraphs from 'remark-squeeze-paragraphs'

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

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

API

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

unified().use(remarkSqueezeParagraphs)

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

Keywords

FAQs

Last updated on 03 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc