Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remark-external-links

Package Overview
Dependencies
Maintainers
14
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-external-links

Automatically adds the target and rel attributes to external links

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2M
decreased by-16.47%
Maintainers
14
Weekly downloads
 
Created

What is remark-external-links?

The remark-external-links package is a plugin for the Remark Markdown processor that automatically modifies links in Markdown files. It is primarily used to add attributes like target and rel to external links, enhancing security and usability without manual HTML tagging.

What are remark-external-links's main functionalities?

Adding attributes to external links

This feature allows users to automatically add specific attributes such as target='_blank' and rel='nofollow noopener noreferrer' to external links in Markdown content. This enhances security by preventing tabnapping and improves SEO through 'nofollow'. The code sample demonstrates how to set up the plugin with Remark to process a simple Markdown string.

const remark = require('remark');
const html = require('remark-html');
const externalLinks = require('remark-external-links');

remark()
  .use(externalLinks, {target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer']})
  .use(html)
  .process('Check out [Google](https://google.com)!', function (err, file) {
    console.log(String(file));
  });

Other packages similar to remark-external-links

Keywords

FAQs

Package last updated on 22 Nov 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc