mdast-util-definitions

WebJar for mdast-util-definitions

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

mdast-util-definitions
Last Version

Last Version

3.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

mdast-util-definitions
WebJar for mdast-util-definitions
Project URL

Project URL

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

Source Code Management

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

Download mdast-util-definitions

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-definitions/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mdast-util-definitions</artifactId>
    <version>3.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-definitions/
implementation 'org.webjars.npm:mdast-util-definitions:3.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/mdast-util-definitions/
implementation ("org.webjars.npm:mdast-util-definitions:3.0.1")
'org.webjars.npm:mdast-util-definitions:jar:3.0.1'
<dependency org="org.webjars.npm" name="mdast-util-definitions" rev="3.0.1">
  <artifact name="mdast-util-definitions" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mdast-util-definitions', version='3.0.1')
)
libraryDependencies += "org.webjars.npm" % "mdast-util-definitions" % "3.0.1"
[org.webjars.npm/mdast-util-definitions "3.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-definitions

Build Coverage Downloads Size Sponsors Backers Chat

mdast utility to get definitions by identifier.

Supports funky keys, like __proto__ or toString.

Install

npm:

npm install mdast-util-definitions

npm with TypeScript support:

npm install mdast-util-definitions @types/mdast

Use

var remark = require('remark')
var definitions = require('mdast-util-definitions')

var ast = remark().parse('[example]: https://example.com "Example"')

var definition = definitions(ast)

definition('example')
// => {type: 'definition', 'title': 'Example', ...}

definition('foo')
// => null

API

definitions(tree)

Create a cache of all definitions in tree.

Uses CommonMark precedence: prefers the first definitions for duplicate definitions.

Returns

Function

definition(identifier)

Parameters
Returns

Node?Definition, if found.

Security

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

Additionally, safe guards are in place to protect against prototype poisoning.

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
3.0.1
1.2.5
1.2.4