This repository was archived by the owner on Jul 3, 2020. It is now read-only.
Releases: zhouzi/linkhunter
Releases · zhouzi/linkhunter
Release list
v3.1.1
v3.1.0
- Improved regular expressions to avoid matching trailing punctuation marks and wrappers. Meaning it's now able to match:
site.comin(site.com),site.com.,site.com...,site.com!, and so on.site.cominSome string ((whatever(site.com)some stuff) theresomeone@domain.cominWhatever (stuff((there(or(someone@domain.com)So weird) string...
- Improved user-typed url regexp to match
github.com/angular.js(urls with punctuation marks) - Improved regexp to match protocoled urls, no matter what's preceding it. It's now able to match
http://site.cominWhat?http://site.com - Fixed urls regexps to avoid matching sub paths that do not start by a slash. It's no more matching
site.com)whateverbutsite.com/whatever
v3.0.2
v3.0.1
v3.0.0
- The usage of linkhunter as a constructor made no sense so it's now just an object exposing the whole API.
- The LinkClass has been removed and each of its method has been transferred to linkhunter. It means that chaining operation is now much more simple and there's less concepts to learn.
linkhunter.linky()'soperationoption has been replaced by individual properties that alter the link's display value (see documentation for more details).- The angular wrapper has been updated (module, service and filter renamed).
- Added support for non-browser environment by following the UMD pattern.
v2.0.1
v2.0.0
mailto:is now considered to be emails' protocol, meaningLink('email@domain.com').withProtocol()now returnsmailto:email@domain.com.- The
targetBlankoption of.linky()is replaced bytargetto allow any target value. - Improved the email matching.
- It's now using the "domain pattern" regexp and match properly
firstname.lastname@email.address-site.com. - Added more tests to the specs.
- It's now using the "domain pattern" regexp and match properly
.getLinks()now ignore emails by default..looksLikeALink()now ignore emails by default.- Added the
forceCleanUpoption to.shorten()(true by default). - LinkHunter is now available as a bower component:
bower install linkhunter.
Improve regexp matching
- Lots of improvements in the regexp
- Regular urls (the ones with a protocol) now also benefit from the domain pattern. Which means that everything that's before the first slash must looks like a domain name so
http://.is no more matched for example. - Partial urls are no more matched by the "user typed" regexp. Meaning
github.com/angularis no more matched fromgithub.com/angular.js. In such case the url is completely dropped because:- Matching partial urls is pointless and would surely lead to mistakes.
- We can't be sure whether what's behind the punctuation mark (the dot in this case) is part of the url or not.
- Regular urls (the ones with a protocol) now also benefit from the domain pattern. Which means that everything that's before the first slash must looks like a domain name so
- Added a
.replaceLinks(callback)method so your could benefit from LinkHunter's regexps to replace links the way you want to. This is method is now also used by.linky(). .linky()now supports more options like beautify, shorten and clean up.- Every link object has now a
.originalHasProtocolproperty which is true when the original url has a protocol. - LinkHunter is now also available as an Angular module.
- Fixed an issue where
.getLinks()wasn't setting emails' type to "email".