Socket
Socket
Sign inDemoInstall

remark-external-links

Package Overview
Dependencies
6
Maintainers
14
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 3.1.1

4

index.js
var visit = require('unist-util-visit')
var definitions = require('mdast-util-definitions')
var spaceSeparated = require('space-separated-tokens').parse
var isAbsoluteURL = require('is-absolute-url')
module.exports = externalLinks
var relative = /^[^/]+\/[^/].*$|^\/[^/].*$/
var defaultTarget = '_blank'

@@ -32,3 +32,3 @@ var defaultRel = ['nofollow', 'noopener', 'noreferrer']

if (ctx && ctx.url.charAt(0) !== '#' && !relative.test(ctx.url)) {
if (ctx && isAbsoluteURL(ctx.url)) {
data = node.data || (node.data = {})

@@ -35,0 +35,0 @@ props = data.hProperties || (data.hProperties = {})

{
"name": "remark-external-links",
"version": "3.1.0",
"version": "3.1.1",
"description": "Automatically adds the target and rel attributes to external links",

@@ -25,2 +25,3 @@ "license": "MIT",

"dependencies": {
"is-absolute-url": "^2.1.0",
"mdast-util-definitions": "^1.2.3",

@@ -27,0 +28,0 @@ "space-separated-tokens": "^1.1.2",

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