🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

rehype-target-blank

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rehype-target-blank

Rehype plugin to set the target of to _blank.

1.0.6
latest
Source
npm
Version published
Weekly downloads
275
-9.84%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

rehype

FAQs

Package last updated on 09 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts