remark-inline-links
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

remark-inline-links

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

3.1.3  •  Updated 8 months ago  •  by remarkjs  •  MIT License

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

remark().use(inlineLinks[, options])

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.

Related

  • remark-bookmarks — Link manager
  • remark-reference-links — Reverse of remark-inline-links, thus rewriting normal links and images into references and definitions
  • remark-defsplit — Practically the same as remark-reference-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, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Popularity

Weekly Downloads
11.2K
Stars
8

Maintenance

Development

Last ver 10 months ago
Created 4 years ago
Last commit 8 months ago
18 days between commits

Technology

Node version: 12.2.0
8.2K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

3 contributors
Titus Wormer
Maintainer, 80 commits, 1 merges
Greenkeeper
2 commits, 5 PRs
Works at greenkeeperio
Jonathan Haines
Maintainer
Christian Murphy
Maintainer
Works at Unicon, Inc.
Marouane Fazouane
Maintainer
Works at MYTRAFFIC
John Otander
Maintainer
Works at gatsbyjs

Tags

unified
remark
plugin
mdast
markdown
reference
definition
normal
link
image
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.