Remarkable plugin adds target
and rel
attributes for external links.
-
npm:
npm install --save-dev remarkable-extlink
-
yarn:
yarn add -D remarkable-extlink
const Remarkable = require('remarkable');
const extLink = require('remarkable-extlink');
const md = new Remarkable();
md
.use(extlink, {
host: 'my-host.com'
});
Required
You site host name to detect external links.
Target link attribute value, default _blank
.
Rel link attribute value, default nofollow noreferrer noopener
.