unified

Project:remarkjs/remark-inline-links

Package:remark-inline-links@3.1.3

  1. Dependencies:3·Dependents:6
  2. remark plugin to transform references and definitions into normal links and images
  1. remark 165
  2. unified 132
  3. plugin 88
  4. markdown 82
  5. mdast 68
  6. link 13
  7. definition 12
  8. image 11
  9. reference 9

remark-inline-links

Build Coverage Downloads Size Sponsors Backers Chat

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

Install

npm:

npm install remark-inline-links

Use

Say we have the following file, example.md:

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

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

[foo]: 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-inline-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](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").

API

Plugin to transform references and definitions into normal links and images.

options
options.commonmark

Handle definitions as commonmark (boolean, default: false). The default behaviour is to prefer the last found duplicate definition. Turn on to use CommonMark handling of duplicate definitions: use the first definition, ignore duplicate 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, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer