Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
mdast-squeeze-paragraphs
Advanced tools
Readme
mdast utility to remove empty paragraphs from a tree.
Paragraphs are considered empty if they do not contain non-whitespace characters.
npm:
npm install mdast-squeeze-paragraphs
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' } ] } ] }
squeezeParagraphs(tree)
Modifies tree in-place.
Returns tree
.
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 plugin wrapperSee 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
FAQs
mdast utility to remove empty paragraphs from a tree
The npm package mdast-squeeze-paragraphs receives a total of 991,786 weekly downloads. As such, mdast-squeeze-paragraphs popularity was classified as popular.
We found that mdast-squeeze-paragraphs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.