Package Exports
- remark-defsplit
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-defsplit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
remark-defsplit
remark plugin to change links and images to references with separate definitions.
Install
npm:
npm install remark-defsplitUse
Say we have the following file, example.md.
[](https://travis-ci.org/remarkjs/remark-defsplit)And our script, example.js, looks as follows:
var vfile = require('to-vfile')
var remark = require('remark')
var defsplit = require('remark-defsplit')
remark()
.use(defsplit, {id: ['travis-badge', 'travis']})
.process(vfile.readSync('example.md'), function(err, file) {
if (err) throw err
console.log(String(file))
})Now, running node example yields:
[![Build Status][travis-badge]][travis]
[travis-badge]: https://travis-ci.org/remarkjs/remark-defsplit.svg?branch=master
[travis]: https://travis-ci.org/remarkjs/remark-defsplitAPI
remark().use(defsplit[, options])
Change links and images to references with separate definitions.
options.id
Identifiers to use for new definitions instead of autogenerated ones (string
or Array.<String>, default: []).
Security
Use of remark-defsplit does not involve rehype
(hast) or user content so there are no openings for
cross-site scripting (XSS) attacks.
Related
remark-reference-links— Practically the same asremark-defsplit, but with numeric identifiers instead of URI-based onesremark-inline-links— Reverse, thus rewriting references and definitions into links and images
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 © Eugene Sharygin