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

angular-linkify

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-linkify - npm Package Compare versions

Comparing version 0.3.4 to 0.4.0

2

angular-linkify.js

@@ -12,3 +12,3 @@ angular.module('linkify', []);

var _text = _str.replace( /(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+(?![^\s]*?")([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/ig, function(url) {
var _text = _str.replace( /(?:https?\:\/\/|www\.)+(?![^\s]*?")([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/ig, function(url) {
var wrap = document.createElement('div');

@@ -15,0 +15,0 @@ var anch = document.createElement('a');

/*
angular-linkify - v0.3.4 - 7/7/2014
angular-linkify - v0.4.0 - 7/7/2014
Angular filter to linkify urls, "@" usernames, and hashtags.
Copyright (c) 2014 ; Licensed
*/
angular.module("linkify",[]),angular.module("linkify").filter("linkify",function(){"use strict";function linkify(_str,type){if(_str){var _text=_str.replace(/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+(?![^\s]*?")([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?/gi,function(url){var wrap=document.createElement("div"),anch=document.createElement("a");return anch.href=url,anch.target="_blank",anch.innerHTML=url,wrap.appendChild(anch),wrap.innerHTML});return _text?("twitter"===type&&(_text=_text.replace(/(|\s)*@(\w+)/g,'$1<a href="https://twitter.com/$2" target="_blank">@$2</a>'),_text=_text.replace(/(^|\s)*#(\w+)/g,'$1<a href="https://twitter.com/search?q=%23$2" target="_blank">#$2</a>')),"github"===type&&(_text=_text.replace(/(|\s)*@(\w+)/g,'$1<a href="https://github.com/$2" target="_blank">@$2</a>')),_text):""}}return function(text,type){return linkify(text,type)}}).factory("linkify",["$filter",function($filter){"use strict";function _linkifyAsType(type){return function(str){return $filter("linkify")(str,type)}}return{twitter:_linkifyAsType("twitter"),github:_linkifyAsType("github"),normal:_linkifyAsType()}}]).directive("linkify",["$filter","$timeout","linkify",function($filter,$timeout,linkify){"use strict";return{restrict:"A",link:function(scope,element,attrs){var type=attrs.linkify||"normal";$timeout(function(){element.html(linkify[type](element.html()))})}}}]);
angular.module("linkify",[]),angular.module("linkify").filter("linkify",function(){"use strict";function linkify(_str,type){if(_str){var _text=_str.replace(/(?:https?\:\/\/|www\.)+(?![^\s]*?")([\w.,@?^=%&amp;:\/~+#-]*[\w@?^=%&amp;\/~+#-])?/gi,function(url){var wrap=document.createElement("div"),anch=document.createElement("a");return anch.href=url,anch.target="_blank",anch.innerHTML=url,wrap.appendChild(anch),wrap.innerHTML});return _text?("twitter"===type&&(_text=_text.replace(/(|\s)*@(\w+)/g,'$1<a href="https://twitter.com/$2" target="_blank">@$2</a>'),_text=_text.replace(/(^|\s)*#(\w+)/g,'$1<a href="https://twitter.com/search?q=%23$2" target="_blank">#$2</a>')),"github"===type&&(_text=_text.replace(/(|\s)*@(\w+)/g,'$1<a href="https://github.com/$2" target="_blank">@$2</a>')),_text):""}}return function(text,type){return linkify(text,type)}}).factory("linkify",["$filter",function($filter){"use strict";function _linkifyAsType(type){return function(str){return $filter("linkify")(str,type)}}return{twitter:_linkifyAsType("twitter"),github:_linkifyAsType("github"),normal:_linkifyAsType()}}]).directive("linkify",["$filter","$timeout","linkify",function($filter,$timeout,linkify){"use strict";return{restrict:"A",link:function(scope,element,attrs){var type=attrs.linkify||"normal";$timeout(function(){element.html(linkify[type](element.html()))})}}}]);
{
"name": "angular-linkify",
"version": "0.3.4",
"version": "0.4.0",
"main": "angular-linkify.js",

@@ -5,0 +5,0 @@ "description": "Angular filter to linkify urls, \"@\" usernames, and hashtags.",

{
"name": "angular-linkify",
"version": "0.3.4",
"version": "0.4.0",
"description": "Angular filter to linkify urls, \"@\" usernames, and hashtags.",

@@ -5,0 +5,0 @@ "main": "angular-linkify.js",

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