Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mdast-squeeze-paragraphs

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-squeeze-paragraphs

Remove empty paragraphs from mdast tree

  • 3.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
decreased by-8.27%
Maintainers
2
Weekly downloads
 
Created
Source

mdast-squeeze-paragraphs Build Coverage Downloads Chat

Remove empty paragraphs from mdast syntax trees.

Paragraphs are considered empty if they do not contain non-whitespace characters.

Installation

npm:

npm install mdast-squeeze-paragraphs

Usage

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.

Contribute

See contributing.md in syntax-tree/mdast for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Eugene Sharygin

Keywords

FAQs

Package last updated on 05 Dec 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc