1.0.1 • Published 11 months ago

rehype-target-plugin v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

rehype-target-plugin

Zero-config rehype plugin to add target="_blank" to your external links. Only one dependency.

Install

npm install rehype-target-plugin

How to use

import { rehype } from "rehype";
import rehypeTargetBlank from 'rehype-target-plugin'

rehype()
  .use(rehypeTargetBlank)
  .process('<a href="https://external.com">external link</a>')

Output

<a href="https://external.com" target="_blank">external link</a>

See the example.js

node example.js

License

MIT

1.0.1

11 months ago

1.0.0

11 months ago