JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 50520
  • Score
    100M100P100Q156536F
  • License MIT

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

Package Exports

  • remark-inline-links

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remark-inline-links) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

remark-inline-links

Build Coverage Downloads Size Sponsors Backers Chat

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

Note!

This plugin is ready for the new parser in remark (remarkjs/remark#536). The current and previous versions of the plugin work with the current and previous versions of remark.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

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 module, example.js, looks as follows:

import fs from 'node:fs'
import remark from 'remark'
import remarkInlineLinks from 'remark-inline-links'

const buf = fs.readFileSync('example.md')

remark()
  .use(remarkInlineLinks)
  .process(buf)
  .then((file) => {
    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

This package exports no identifiers. The default export is remarkInlineLinks.

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

Security

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

  • 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, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer