remark plugin to remove empty (or whitespace only) paragraphs.
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!
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('!(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"
Remove empty (or white-space only) paragraphs.
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