Gathering detailed insights and metrics for mdast-squeeze-paragraphs
Gathering detailed insights and metrics for mdast-squeeze-paragraphs
Gathering detailed insights and metrics for mdast-squeeze-paragraphs
Gathering detailed insights and metrics for mdast-squeeze-paragraphs
utility to remove empty paragraphs from an mdast tree
npm install mdast-squeeze-paragraphs
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
7 Stars
97 Commits
1 Forks
10 Watchers
1 Branches
13 Contributors
Updated on May 24, 2025
Latest Version
6.0.0
Package Id
mdast-squeeze-paragraphs@6.0.0
Unpacked Size
9.22 kB
Size
3.74 kB
File Count
7
NPM Version
9.7.2
Node Version
20.0.0
Published on
Jul 08, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
mdast utility to remove empty paragraphs.
This package is a utility that removes empty paragraphs, left over from other operations, from the tree. Paragraphs are considered empty if they do not contain non-whitespace characters.
Probably never! You should try to clean your trees yourself.
A plugin, remark-squeeze-paragraphs
, exists that
does the same but for remark.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install mdast-squeeze-paragraphs
In Deno with esm.sh
:
1import {squeezeParagraphs} from 'https://esm.sh/mdast-squeeze-paragraphs@6'
In browsers with esm.sh
:
1<script type="module"> 2 import {squeezeParagraphs} from 'https://esm.sh/mdast-squeeze-paragraphs@6?bundle' 3</script>
1import {squeezeParagraphs} from 'mdast-squeeze-paragraphs' 2import {u} from 'unist-builder' 3 4const tree = u('root', [ 5 u('paragraph', []), 6 u('paragraph', [u('text', 'Alpha')]), 7 u('paragraph', [u('text', ' ')]) 8]) 9 10squeezeParagraphs(tree) 11 12console.dir(tree, {depth: null})
Yields:
1{ type: 'root', 2 children: 3 [ { type: 'paragraph', 4 children: [ { type: 'text', value: 'Alpha' } ] } ] }
This package exports the identifier
squeezeParagraphs
.
There is no default export.
squeezeParagraphs(tree)
Remove empty paragraphs in tree
.
tree
(Node
)
— tree to changeNothing (undefined
).
This package is fully typed with TypeScript. It exports no additional types..
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
mdast-squeeze-paragraphs@^6
, compatible with Node.js 16.
Use of mdast-squeeze-paragraphs
does not involve hast or user content
so there are no openings for cross-site scripting (XSS) attacks.
remark-squeeze-paragraphs
— remark pluginmdast-util-compact
— make a tree compactSee 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, organization, or community you agree to abide by its terms.
MIT © Eugene Sharygin
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More