Socket
Socket
Sign inDemoInstall

remark-external-links

Package Overview
Dependencies
18
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remark-external-links

Legacy remark plugin to automatically add target and rel attributes to external links — please use `rehype-external-links`


Version published
Weekly downloads
3.7M
decreased by-4.16%
Maintainers
2
Install size
364 kB
Created
Weekly downloads
 

Package description

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

Readme

Source

Stability: Legacy. This package is no longer recommended for use. It’s still covered by semantic-versioning guarantees and not yet deprecated, but use of this package should be avoided. Please use remark-rehype to move from remark (markdown) to rehype (HTML) and then replace remark-external-links with rehype-external-links.

Legacy documentation for this package is still available in Git.

License

MIT © Cédric Delpoux

FAQs

Last updated on 16 Aug 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc