-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
76 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/*! | ||
* Autolinker.js | ||
* 1.4.3 | ||
* 1.4.4 | ||
* | ||
* Copyright(c) 2017 Gregory Jacobs <[email protected]> | ||
* MIT License | ||
|
@@ -240,7 +240,7 @@ Autolinker.parse = function( textOrHtml, options ) { | |
* | ||
* Ex: 0.25.1 | ||
*/ | ||
Autolinker.version = '1.4.3'; | ||
Autolinker.version = '1.4.4'; | ||
|
||
|
||
Autolinker.prototype = { | ||
|
@@ -1546,9 +1546,14 @@ Autolinker.RegexLib = (function() { | |
// See documentation below | ||
var alphaNumericCharsStr = alphaCharsStr + decimalNumbersStr; | ||
|
||
// Simplified IP regular expression | ||
var ipRegex = new RegExp( '(?:[' + decimalNumbersStr + ']{1,3}\\.){3}[' + decimalNumbersStr + ']{1,3}' ); | ||
|
||
// Protected domain label which do not allow "-" character on the beginning and the end of a single label | ||
var domainLabelStr = '[' + alphaNumericCharsStr + '](?:[' + alphaNumericCharsStr + '\\-]*[' + alphaNumericCharsStr + '])?'; | ||
|
||
// See documentation below | ||
var domainNameRegex = new RegExp( '[' + alphaNumericCharsStr + '.\\-]*[' + alphaNumericCharsStr + '\\-]' ); | ||
var domainNameRegex = new RegExp( '(?:(?:(?:' + domainLabelStr + '\\.)*(?:' + domainLabelStr + '))|(?:' + ipRegex.source + '))' ); | ||
|
||
return { | ||
|
||
|
@@ -3206,7 +3211,11 @@ Autolinker.matcher.Email = Autolinker.Util.extend( Autolinker.matcher.Matcher, { | |
*/ | ||
matcherRegex : (function() { | ||
var alphaNumericChars = Autolinker.RegexLib.alphaNumericCharsStr, | ||
emailRegex = new RegExp( '[' + alphaNumericChars + '\\-_\';:&=+$.,]+@' ), // something@ for email addresses (a.k.a. local-part) | ||
specialCharacters = '!#$%&\'*+\\-\\/=?^_`{|}~', | ||
restrictedSpecialCharacters = '\\s"(),:;<>@\\[\\]', | ||
validCharacters = alphaNumericChars + specialCharacters, | ||
validRestrictedCharacters = validCharacters + restrictedSpecialCharacters, | ||
emailRegex = new RegExp( '(?:(?:[' + validCharacters + '](?![^@]*\\.\\.)(?:[' + validCharacters + '.]*[' + validCharacters + '])?)|(?:\\"[' + validRestrictedCharacters + '.]+\\"))@'), | ||
domainNameRegex = Autolinker.RegexLib.domainNameRegex, | ||
tldRegex = Autolinker.tldRegex; // match our known top level domains (TLDs) | ||
|
||
|
@@ -3373,7 +3382,7 @@ Autolinker.matcher.Phone = Autolinker.Util.extend( Autolinker.matcher.Matcher, { | |
var matchedText = match[0], | ||
cleanNumber = matchedText.replace(/[^0-9,;#]/g, ''), // strip out non-digit characters exclude comma semicolon and # | ||
plusSign = !!match[1]; // match[ 1 ] is the prefixed plus sign, if there is one | ||
if (/\D/.test(match[2]) && /\D/.test(matchedText)) { | ||
if (this.testMatch(match[2]) && this.testMatch(matchedText)) { | ||
matches.push(new Autolinker.match.Phone({ | ||
tagBuilder: tagBuilder, | ||
matchedText: matchedText, | ||
|
@@ -3385,9 +3394,14 @@ Autolinker.matcher.Phone = Autolinker.Util.extend( Autolinker.matcher.Matcher, { | |
} | ||
|
||
return matches; | ||
}, | ||
|
||
testMatch: function(text) { | ||
return /\D/.test(text); | ||
} | ||
|
||
} ); | ||
|
||
/*global Autolinker */ | ||
/** | ||
* @class Autolinker.matcher.Mention | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.../data-1df28a367878e4e8fc26f668c464fdb1.js → .../data-b1cba292aac630ea4a3da8e7d4445f33.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.