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

linkifyjs

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkifyjs - npm Package Compare versions

Comparing version 2.0.0-beta.8 to 2.0.0-beta.9

3

lib/linkify-element.js

@@ -40,4 +40,5 @@ /**

var token = tokens[i];
var validated = token.isLink && _linkify.options.resolve(opts.validate, token.toString(), token.type);
if (token.isLink) {
if (token.isLink && validated) {

@@ -44,0 +45,0 @@ var href = token.toHref(opts.defaultProtocol),

@@ -98,2 +98,4 @@ 'use strict';

var token = tokens[i];
var validated = token.isLink && linkify.options.resolve(opts.validate, token.toString(), token.type);
if (token.type === 'nl' && opts.nl2br) {

@@ -107,3 +109,3 @@ result.push({

continue;
} else if (!token.isLink) {
} else if (!token.isLink || !validated) {
result.push({ type: Chars, chars: token.toString() });

@@ -110,0 +112,0 @@ continue;

@@ -68,3 +68,4 @@ 'use strict';

target: data.linkifyTarget,
linkClass: data.linkifyLinkclass
linkClass: data.linkifyLinkclass,
validate: data.linkifyValidate
};

@@ -71,0 +72,0 @@ var $target = target === 'this' ? $this : $this.find(target);

@@ -41,4 +41,6 @@ /**

var token = tokens[i];
if (token.isLink) {
var validated = token.isLink && _linkify.options.resolve(opts.validate, token.toString(), token.type);
if (token.isLink && validated) {
var href = token.toHref(opts.defaultProtocol),

@@ -45,0 +47,0 @@ formatted = _linkify.options.resolve(opts.format, token.toString(), token.type),

@@ -8,2 +8,6 @@ 'use strict';

function yes(val) {
return true;
}
function typeToTarget(href, type) {

@@ -21,2 +25,3 @@ return type === 'url' ? '_blank' : null;

format: opts.format || noop,
validate: opts.validate || yes,
formatHref: opts.formatHref || noop,

@@ -23,0 +28,0 @@ newLine: opts.newLine || false, // deprecated

{
"name": "linkifyjs",
"version": "2.0.0-beta.8",
"version": "2.0.0-beta.9",
"description": "Intelligent link recognition, made easy",

@@ -5,0 +5,0 @@ "repository": {

@@ -107,3 +107,3 @@ # Linkify

var linkify = require('linkifyjs');
require('linkifyjs/plugin/hashtag')(linkify); // optional
require('linkifyjs/plugins/hashtag')(linkify); // optional
var linkifyHtml = require('linkifyjs/html');

@@ -110,0 +110,0 @@ ```

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