Package Exports
- mdast-squeeze-paragraphs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mdast-squeeze-paragraphs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
mdast-squeeze-paragraphs
mdast utility to remove empty paragraphs from a tree.
Paragraphs are considered empty if they do not contain non-whitespace characters.
Install
npm:
npm install mdast-squeeze-paragraphsUsage
var u = require('unist-builder')
var squeezeParagraphs = require('mdast-squeeze-paragraphs')
var tree = u('root', [
u('paragraph', []),
u('paragraph', [u('text', 'Alpha')]),
u('paragraph', [u('text', ' ')])
])
squeezeParagraphs(tree)
console.dir(tree, {depth: null})Yields:
{ type: 'root',
children:
[ { type: 'paragraph',
children: [ { type: 'text', value: 'Alpha' } ] } ] }API
squeezeParagraphs(tree)
Modifies tree in-place.
Returns tree.
Related
remark-squeeze-paragraphs— remark plugin wrapper
Contribute
See contributing.md in syntax-tree/.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, organisation, or community you agree to abide by its terms.
License
MIT © Eugene Sharygin