mdast-util-compact

WebJar for mdast-util-compact

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

mdast-util-compact
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

mdast-util-compact
WebJar for mdast-util-compact
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/syntax-tree/mdast-util-compact

Download mdast-util-compact

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-compact/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mdast-util-compact</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-compact/
implementation 'org.webjars.npm:mdast-util-compact:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-compact/
implementation ("org.webjars.npm:mdast-util-compact:2.0.1")
'org.webjars.npm:mdast-util-compact:jar:2.0.1'
<dependency org="org.webjars.npm" name="mdast-util-compact" rev="2.0.1">
  <artifact name="mdast-util-compact" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mdast-util-compact', version='2.0.1')
)
libraryDependencies += "org.webjars.npm" % "mdast-util-compact" % "2.0.1"
[org.webjars.npm/mdast-util-compact "2.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : unist-util-visit jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

mdast-util-compact

Build Coverage Downloads Size Sponsors Backers Chat

mdast utility to make trees compact: collapse adjacent text nodes and blockquotes.

Install

npm:

npm install mdast-util-compact

Use

var u = require('unist-builder')
var compact = require('mdast-util-compact')

var tree = u('strong', [u('text', 'alpha'), u('text', ' '), u('text', 'bravo')])

compact(tree)

console.log(tree)

Yields:

{ type: 'strong',
  children: [ { type: 'text', value: 'alpha bravo' } ] }

API

compact(tree)

Walk the tree and collapse nodes. Combines adjacent texts and collapses blockquotes.

Handles positional information properly.

Returns

The given tree.

Security

Use of mdast-util-compact does not involve hast or user content so there are no openings for cross-site scripting (XSS) attacks.

Related

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, organization, or community you agree to abide by its terms.

License

MIT ยฉ Titus Wormer

org.webjars.npm
๐ŸŒฒ๐ŸŒฒ๐ŸŒฒ๐ŸŒณ๐ŸŒฒ๐ŸŒณ๐ŸŒฒ๐ŸŒฒ๐ŸŒฒ๐ŸŒณ๐ŸŒณ๐ŸŒฒ๐ŸŒฒ๐ŸŒณ๐ŸŒฒ๐ŸŒฒ๐ŸŽ„๐ŸŒฒ๐ŸŒณ๐ŸŒฒ๐ŸŒฒ๐ŸŒณ๐Ÿป๐ŸŒณ๐ŸŒณ๐ŸŒณ๐ŸŒฒ๐ŸŒฒ๐ŸŒณ๐ŸŒฒ๐ŸŽ„๐ŸŒฒ๐ŸŒณ๐ŸŒฒ๐ŸŒฒ๐ŸŒณ๐ŸŒณ๐ŸŒณ

Versions

Version
2.0.1
1.0.4
1.0.3
1.0.2