Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remark-inline-links

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-inline-links

Transform references and definitions into normal links and images

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
increased by8.1%
Maintainers
1
Weekly downloads
 
Created
Source

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

Installation

npm:

npm install remark-inline-links

Usage

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

Transform references and definitions into normal links and images.

Options
options.commonmark

boolean, default: false — Turn on to use CommonMark handling of duplicate definitions: use the first definition, ignore duplicate definitions. The default behaviour is to prefer the last found duplicate definition.

  • 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 contribute.md in remarkjs/remarkjs for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 10 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc