rehype-target-blank

1.0.6 • Public • Published

rehype-target-blank

Rehype plugin to set the target of <a/> to blank.

Install

This package is ESM-only: Node 12+ is needed to use it and it must be importeded instead of requiredd.

npm instal rehype-target-blank

How to use

Usage

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

rehype()
  .use(rehypeTargetBlank)
  .process(/* some html */);

Example

// before
<a href="https://www.google.com">

// after
<a href="https://www.google.com" target="_blank">

License

License

Readme

Keywords

Package Sidebar

Install

npm i rehype-target-blank

Weekly Downloads

293

Version

1.0.6

License

MIT

Unpacked Size

3.61 kB

Total Files

5

Last publish

Collaborators

  • tsuizen