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 - npm Package Compare versions

Comparing version 3.0.4 to 3.1.0

21

index.js

@@ -9,19 +9,18 @@ 'use strict';

function inlineLinks() {
function inlineLinks(options) {
return transformer;
}
/* Transformer. */
function transformer(tree) {
var reference = referenceFactory(tree);
function transformer(tree) {
var reference = referenceFactory(tree, options);
remove(tree, 'definition');
remove(tree, 'definition');
visit(tree, 'imageReference', reference);
visit(tree, 'linkReference', reference);
visit(tree, 'imageReference', reference);
visit(tree, 'linkReference', reference);
}
}
/* Factory to transform a reference based on `definitions`. */
function referenceFactory(tree) {
var definitions = getDefinitions(tree);
function referenceFactory(tree, options) {
var definitions = getDefinitions(tree, options);

@@ -52,5 +51,5 @@ return reference;

parent.children.splice(index, 1, replacement);
parent.children[index] = replacement;
}
}
}
{
"name": "remark-inline-links",
"version": "3.0.4",
"version": "3.1.0",
"description": "Transform references and definitions into normal links and images",

@@ -15,4 +15,4 @@ "license": "MIT",

],
"repository": "https://github.com/wooorm/remark-inline-links",
"bugs": "https://github.com/wooorm/remark-inline-links/issues",
"repository": "remarkjs/remark-inline-links",
"bugs": "https://github.com/remarkjs/remark-inline-links/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",

@@ -34,4 +34,4 @@ "contributors": [

"nyc": "^11.0.0",
"remark": "^7.0.0",
"remark-cli": "^3.0.0",
"remark": "^8.0.0",
"remark-cli": "^4.0.0",
"remark-preset-wooorm": "^3.0.0",

@@ -65,4 +65,6 @@ "tape": "^4.4.0",

"remarkConfig": {
"plugins": ["preset-wooorm"]
"plugins": [
"preset-wooorm"
]
}
}
# remark-inline-links [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
[**remark**][remark] plug-in to transform references and definitions
into normal links and images.
[**remark**][remark] plugin to transform references and definitions into normal
links and images.

@@ -51,15 +51,35 @@ ## Installation

### `remark().use(inlineLinks)`
### `remark().use(inlineLinks[, options])`
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.
## Related
* [`remark-reference-links`](https://github.com/wooorm/remark-reference-links)
— Reverse, thus rewriting normal links and images into references
and definitions
* [`remark-bookmarks`](https://github.com/ben-eb/remark-bookmarks)
— Link manager
* [`remark-reference-links`](https://github.com/remarkjs/remark-reference-links)
— Reverse of `remark-inline-links`, thus rewriting normal links and images
into references and definitions
* [`remark-defsplit`](https://github.com/eush77/remark-defsplit)
— Practically the same as `remark-reference-links`, but with
URI-based identifiers instead of numerical ones
* [`remark-unlink`](https://github.com/eush77/remark-unlink)
— Remove all links, references and definitions
## Contribute
See [`contribute.md` in `remarkjs/remarkjs`][contribute] for ways to get
started.
This organisation has a [Code of Conduct][coc]. By interacting with this
repository, organisation, or community you agree to abide by its terms.
## License

@@ -71,13 +91,13 @@

[build-badge]: https://img.shields.io/travis/wooorm/remark-inline-links.svg
[build-badge]: https://img.shields.io/travis/remarkjs/remark-inline-links.svg
[build-status]: https://travis-ci.org/wooorm/remark-inline-links
[build-status]: https://travis-ci.org/remarkjs/remark-inline-links
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/remark-inline-links.svg
[coverage-badge]: https://img.shields.io/codecov/c/github/remarkjs/remark-inline-links.svg
[coverage-status]: https://codecov.io/github/wooorm/remark-inline-links
[coverage-status]: https://codecov.io/github/remarkjs/remark-inline-links
[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg
[chat-badge]: https://img.shields.io/gitter/room/remarkjs/Lobby.svg
[chat]: https://gitter.im/wooorm/remark
[chat]: https://gitter.im/remarkjs/remark

@@ -90,2 +110,6 @@ [license]: LICENSE

[remark]: https://github.com/wooorm/remark
[remark]: https://github.com/remarkjs/remark
[contribute]: https://github.com/remarkjs/remark/blob/master/contributing.md
[coc]: https://github.com/remarkjs/remark/blob/master/code-of-conduct.md
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