remark-inline-links
Advanced tools
Comparing version
@@ -21,3 +21,3 @@ 'use strict' | ||
/* Factory to transform a reference based on `definitions`. */ | ||
// Factory to transform a reference based on `definitions`. | ||
function referenceFactory(tree, options) { | ||
@@ -28,3 +28,3 @@ var definitions = getDefinitions(tree, options) | ||
/* Transform a reference based on bound `definitions`. */ | ||
// Transform a reference based on bound `definitions`. | ||
function reference(node, index, parent) { | ||
@@ -31,0 +31,0 @@ var definition = definitions(node.identifier) |
{ | ||
"name": "remark-inline-links", | ||
"version": "3.1.2", | ||
"description": "Transform references and definitions into normal links and images", | ||
"version": "3.1.3", | ||
"description": "remark plugin to transform references and definitions into normal links and images", | ||
"license": "MIT", | ||
"keywords": [ | ||
"unified", | ||
"remark", | ||
"plugin", | ||
"mdast", | ||
"markdown", | ||
"reference", | ||
"definition", | ||
"to", | ||
"normal", | ||
"link", | ||
"image", | ||
"remark" | ||
"image" | ||
], | ||
@@ -31,10 +34,10 @@ "repository": "remarkjs/remark-inline-links", | ||
"browserify": "^16.0.0", | ||
"nyc": "^13.0.0", | ||
"prettier": "^1.14.2", | ||
"nyc": "^14.0.0", | ||
"prettier": "^1.0.0", | ||
"remark": "^10.0.0", | ||
"remark-cli": "^6.0.0", | ||
"remark-preset-wooorm": "^4.0.0", | ||
"tape": "^4.4.0", | ||
"tinyify": "^2.4.3", | ||
"xo": "^0.23.0" | ||
"remark-preset-wooorm": "^5.0.0", | ||
"tape": "^4.0.0", | ||
"tinyify": "^2.0.0", | ||
"xo": "^0.24.0" | ||
}, | ||
@@ -41,0 +44,0 @@ "scripts": { |
@@ -6,5 +6,6 @@ # remark-inline-links | ||
[![Downloads][downloads-badge]][downloads] | ||
[![Chat][chat-badge]][chat] | ||
[![Size][size-badge]][size] | ||
[![Sponsors][sponsors-badge]][collective] | ||
[![Backers][backers-badge]][collective] | ||
[![Chat][chat-badge]][chat] | ||
@@ -14,11 +15,11 @@ [**remark**][remark] plugin to transform references and definitions into normal | ||
## Installation | ||
## Install | ||
[npm][]: | ||
```bash | ||
```sh | ||
npm install remark-inline-links | ||
``` | ||
## Usage | ||
## Use | ||
@@ -37,3 +38,3 @@ Say we have the following file, `example.md`: | ||
```javascript | ||
```js | ||
var fs = require('fs') | ||
@@ -63,11 +64,12 @@ var remark = require('remark') | ||
Transform references and definitions into normal links and images. | ||
Plugin to transform references and definitions into normal links and images. | ||
##### Options | ||
##### `options` | ||
###### `options.commonmark` | ||
`boolean`, default: `false` — Turn on to use CommonMark handling of duplicate | ||
definitions: use the first definition, ignore duplicate definitions. | ||
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. | ||
@@ -89,7 +91,9 @@ ## Related | ||
See [`contributing.md` in `remarkjs/remark`][contributing] for ways to get | ||
started. | ||
See [`contributing.md`][contributing] in [`remarkjs/.github`][health] for ways | ||
to get started. | ||
See [`support.md`][support] for ways to get help. | ||
This organisation has a [Code of Conduct][coc]. By interacting with this | ||
repository, organisation, or community you agree to abide by its terms. | ||
This project has a [Code of Conduct][coc]. | ||
By interacting with this repository, organisation, or community you agree to | ||
abide by its terms. | ||
@@ -102,3 +106,3 @@ ## License | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-inline-links.svg | ||
[build-badge]: https://img.shields.io/travis/remarkjs/remark-inline-links/master.svg | ||
@@ -115,5 +119,5 @@ [build]: https://travis-ci.org/remarkjs/remark-inline-links | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[size-badge]: https://img.shields.io/bundlephobia/minzip/remark-inline-links.svg | ||
[chat]: https://spectrum.chat/unified/remark | ||
[size]: https://bundlephobia.com/result?p=remark-inline-links | ||
@@ -126,12 +130,20 @@ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[license]: license | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[author]: https://wooorm.com | ||
[chat]: https://spectrum.chat/unified/remark | ||
[npm]: https://docs.npmjs.com/cli/install | ||
[remark]: https://github.com/remarkjs/remark | ||
[health]: https://github.com/remarkjs/.github | ||
[contributing]: https://github.com/remarkjs/remark/blob/master/contributing.md | ||
[contributing]: https://github.com/remarkjs/.github/blob/master/contributing.md | ||
[coc]: https://github.com/remarkjs/remark/blob/master/code-of-conduct.md | ||
[support]: https://github.com/remarkjs/.github/blob/master/support.md | ||
[coc]: https://github.com/remarkjs/.github/blob/master/code-of-conduct.md | ||
[license]: license | ||
[author]: https://wooorm.com | ||
[remark]: https://github.com/remarkjs/remark |
8243
5.64%142
9.23%