remark-reference-links

WebJar for remark-reference-links

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

remark-reference-links
Last Version

Last Version

4.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

remark-reference-links
WebJar for remark-reference-links
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/remarkjs/remark-reference-links

Download remark-reference-links

How to add to project

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

Dependencies

compile (1)

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

Project Modules

There are no modules declared in this project.

remark-reference-links

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to transform links and images into references and definitions.

Note!

This plugin is ready for the new parser in remark (remarkjs/remark#536). No change is needed: it works exactly the same now as it did before!

Install

npm:

npm install remark-reference-links

Use

Say we have the following file, example.md:

[foo](http://example.com "Example Domain"), [foo](http://example.com "Example Domain"), [bar](http://example.com "Example Domain").

![foo](http://example.com "Example Domain"), ![foo](http://example.com "Example Domain"), ![bar](http://example.com "Example Domain").

And our script, example.js, looks as follows:

var fs = require('fs')
var remark = require('remark')
var links = require('remark-reference-links')

remark()
  .use(links)
  .process(fs.readFileSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Now, running node example yields:

[foo][1], [foo][1], [bar][1].

![foo][1], ![foo][1], ![bar][1].

[1]: http://example.com "Example Domain"

API

remark().use(referenceLinks)

Plugin to transform links and images into references and definitions.

Security

Use of remark-reference-links does not involve rehype (hast) or user content so there are no openings for cross-site scripting (XSS) attacks.

Related

  • remark-inline-links — Reverse of remark-reference-links, thus rewriting references and definitions into normal links and images
  • remark-defsplit — Practically the same as remark-inline-links, but with URI-based identifiers instead of numerical ones
  • remark-unlink — Remove all links, references and definitions

Contribute

See contributing.md in remarkjs/.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

remark

markdown processor powered by plugins part of the @unifiedjs collective

Versions

Version
4.0.4