$ cnpm install remark-squeeze-paragraphs
remark plugin to remove empty (or whitespace only) paragraphs.
npm:
npm install remark-squeeze-paragraphs
var remark = require('remark')
var stripBadges = require('remark-strip-badges')
var squeezeParagraphs = require('remark-squeeze-paragraphs')
remark()
.use(stripBadges)
.processSync('\n\ntext')
.toString()
// => "\n\ntext\n"
remark()
.use(stripBadges)
.use(squeezeParagraphs)
.processSync('\n\ntext')
.toString()
// => "text\n"
remark().use(squeezeParagraphs)Remove empty (or white-space only) paragraphs.
Use of remark-squeeze-paragraphs does not involve rehype
(hast) or user content so there are no openings for
cross-site scripting (XSS) attacks.
mdast-squeeze-paragraphs
— mdast utility that is in the core of this pluginSee 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.
MIT © Eugene Sharygin
Copyright 2013 - present © cnpmjs.org