mdast-util-to-string

WebJar for mdast-util-to-string

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

mdast-util-to-string
Last Version

Last Version

1.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

mdast-util-to-string
WebJar for mdast-util-to-string
Project URL

Project URL

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

Source Code Management

https://github.com/syntax-tree/mdast-util-to-string

Download mdast-util-to-string

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

mdast-util-to-string

Build Coverage Downloads Size Sponsors Backers Chat

mdast utility to get the plain text content of a node.

Install

npm:

npm install mdast-util-to-string

Use

var unified = require('unified')
var parse = require('remark-parse')
var toString = require('mdast-util-to-string')

var tree = unified()
  .use(parse)
  .parse('Some _emphasis_, **importance**, and `code`.')

console.log(toString(tree)) // => 'Some emphasis, importance, and code.'

API

toString(node)

Get the text content of a node or list of nodes.

The algorithm checks value of node, then alt, and finally title. If no value is found, the algorithm checks the children of node and joins them (without spaces or newlines).

This is not a markdown to plain-text library. Use strip-markdown for that.

Security

Use of mdast-util-to-string does not involve hast, user content, or change the tree, 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
1.0.7
1.0.6