{"library":"mdast-squeeze-paragraphs","title":"mdast Paragraph Squeezer","description":"mdast-squeeze-paragraphs is a focused utility within the unified ecosystem, specifically designed to remove empty paragraphs from an mdast (Markdown Abstract Syntax Tree) tree. It identifies and eliminates paragraphs that contain no non-whitespace characters, often a result of previous tree transformations. The current stable version is 6.0.0. Releases are typically tied to Node.js LTS cycles, with new major versions dropping support for unmaintained Node.js versions. A key differentiator and notable recommendation from its maintainers is that developers should 'probably never!' use this package directly, encouraging users to clean their trees themselves or use the higher-level `remark-squeeze-paragraphs` plugin instead. This package is primarily intended for authors of other mdast utilities or plugins who need fine-grained control over tree sanitation at a low level.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install mdast-squeeze-paragraphs"],"cli":null},"imports":["import { squeezeParagraphs } from 'mdast-squeeze-paragraphs'","import { squeezeParagraphs } from 'https://esm.sh/mdast-squeeze-paragraphs@6'","import * as mod from 'mdast-squeeze-paragraphs'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import {squeezeParagraphs} from 'mdast-squeeze-paragraphs';\nimport {u} from 'unist-builder';\n\nconst tree = u('root', [\n  u('paragraph', []),\n  u('paragraph', [u('text', 'Alpha')]),\n  u('paragraph', [u('text', ' ')])\n]);\n\nsqueezeParagraphs(tree);\n\nconsole.dir(tree, {depth: null});\n// Expected output:\n// { type: 'root',\n//   children:\n//    [ { type: 'paragraph',\n//        children: [ { type: 'text', value: 'Alpha' } ] } ] }","lang":"typescript","description":"Demonstrates how to import and use `squeezeParagraphs` to remove empty paragraphs from an mdast tree created with `unist-builder`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}