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 import
ed instead of require
d.
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()
remark()
.use(remarkStripBadges)
.use(remarkSqueezeParagraphs)
.processSync('![](https://img.shields.io/)\n\ntext')
.toString()
API
This package exports no identifiers.
The default export is 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.
Related
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