Skip to content

Commit 355143d

Browse files
committed
Build 1.4.4 + doc
1 parent 3c47de6 commit 355143d

17 files changed

+76
-34
lines changed

dist/Autolinker.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* Autolinker.js
3-
* 1.4.3
3+
* 1.4.4
44
*
55
* Copyright(c) 2017 Gregory Jacobs <greg@greg-jacobs.com>
66
* MIT License
@@ -240,7 +240,7 @@ Autolinker.parse = function( textOrHtml, options ) {
240240
*
241241
* Ex: 0.25.1
242242
*/
243-
Autolinker.version = '1.4.3';
243+
Autolinker.version = '1.4.4';
244244

245245

246246
Autolinker.prototype = {
@@ -1546,9 +1546,14 @@ Autolinker.RegexLib = (function() {
15461546
// See documentation below
15471547
var alphaNumericCharsStr = alphaCharsStr + decimalNumbersStr;
15481548

1549+
// Simplified IP regular expression
1550+
var ipRegex = new RegExp( '(?:[' + decimalNumbersStr + ']{1,3}\\.){3}[' + decimalNumbersStr + ']{1,3}' );
1551+
1552+
// Protected domain label which do not allow "-" character on the beginning and the end of a single label
1553+
var domainLabelStr = '[' + alphaNumericCharsStr + '](?:[' + alphaNumericCharsStr + '\\-]*[' + alphaNumericCharsStr + '])?';
15491554

15501555
// See documentation below
1551-
var domainNameRegex = new RegExp( '[' + alphaNumericCharsStr + '.\\-]*[' + alphaNumericCharsStr + '\\-]' );
1556+
var domainNameRegex = new RegExp( '(?:(?:(?:' + domainLabelStr + '\\.)*(?:' + domainLabelStr + '))|(?:' + ipRegex.source + '))' );
15521557

15531558
return {
15541559

@@ -3206,7 +3211,11 @@ Autolinker.matcher.Email = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
32063211
*/
32073212
matcherRegex : (function() {
32083213
var alphaNumericChars = Autolinker.RegexLib.alphaNumericCharsStr,
3209-
emailRegex = new RegExp( '[' + alphaNumericChars + '\\-_\';:&=+$.,]+@' ), // something@ for email addresses (a.k.a. local-part)
3214+
specialCharacters = '!#$%&\'*+\\-\\/=?^_`{|}~',
3215+
restrictedSpecialCharacters = '\\s"(),:;<>@\\[\\]',
3216+
validCharacters = alphaNumericChars + specialCharacters,
3217+
validRestrictedCharacters = validCharacters + restrictedSpecialCharacters,
3218+
emailRegex = new RegExp( '(?:(?:[' + validCharacters + '](?![^@]*\\.\\.)(?:[' + validCharacters + '.]*[' + validCharacters + '])?)|(?:\\"[' + validRestrictedCharacters + '.]+\\"))@'),
32103219
domainNameRegex = Autolinker.RegexLib.domainNameRegex,
32113220
tldRegex = Autolinker.tldRegex; // match our known top level domains (TLDs)
32123221

@@ -3373,7 +3382,7 @@ Autolinker.matcher.Phone = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
33733382
var matchedText = match[0],
33743383
cleanNumber = matchedText.replace(/[^0-9,;#]/g, ''), // strip out non-digit characters exclude comma semicolon and #
33753384
plusSign = !!match[1]; // match[ 1 ] is the prefixed plus sign, if there is one
3376-
if (/\D/.test(match[2]) && /\D/.test(matchedText)) {
3385+
if (this.testMatch(match[2]) && this.testMatch(matchedText)) {
33773386
matches.push(new Autolinker.match.Phone({
33783387
tagBuilder: tagBuilder,
33793388
matchedText: matchedText,
@@ -3385,9 +3394,14 @@ Autolinker.matcher.Phone = Autolinker.Util.extend( Autolinker.matcher.Matcher, {
33853394
}
33863395

33873396
return matches;
3397+
},
3398+
3399+
testMatch: function(text) {
3400+
return /\D/.test(text);
33883401
}
33893402

33903403
} );
3404+
33913405
/*global Autolinker */
33923406
/**
33933407
* @class Autolinker.matcher.Mention

dist/Autolinker.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/data-1df28a367878e4e8fc26f668c464fdb1.js renamed to docs/api/data-b1cba292aac630ea4a3da8e7d4445f33.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Autolinker v1.4.3 API Docs</title>
4+
<title>Autolinker v1.4.4 API Docs</title>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
66
<meta http-equiv="X-UA-Compatible" content="chrome=1">
77
<meta name="fragment" content="!">
@@ -10,10 +10,10 @@
1010

1111
<link rel="shortcut icon" type="image/ico" href="favicon.ico" />
1212
<link rel="stylesheet" href="resources/css/app-4689d2a5522dcd3c9e9923ca59c33f27.css" type="text/css" />
13-
<link rel="stylesheet" href="styles-3eba09980fa05ead185cb17d9c0deb0f.css" type="text/css" />
13+
<link rel="stylesheet" href="styles-8184dad50dadb76aad743829a7c19ed0.css" type="text/css" />
1414

1515
<script type="text/javascript" src="extjs/ext-all.js"></script>
16-
<script type="text/javascript" src="data-1df28a367878e4e8fc26f668c464fdb1.js"></script>
16+
<script type="text/javascript" src="data-b1cba292aac630ea4a3da8e7d4445f33.js"></script>
1717

1818
<script type="text/javascript" src="app-0c945a27f43452df695771ddb60b3d14.js"></script>
1919

@@ -22,9 +22,9 @@
2222
</head>
2323
<body id="ext-body">
2424

25-
<div id="loading"><span class="title">Autolinker v1.4.3 API Docs</span><span class="logo"></span></div>
25+
<div id="loading"><span class="title">Autolinker v1.4.4 API Docs</span><span class="logo"></span></div>
2626

27-
<div id="header-content">Autolinker v1.4.3 API Docs</div>
27+
<div id="header-content">Autolinker v1.4.4 API Docs</div>
2828

2929
<div id='categories-content' style='display:none'>
3030
<div class='section'>
@@ -82,7 +82,7 @@ <h3>Others...</h3>
8282

8383

8484

85-
<div id='footer-content' style='display: none'>Generated on Thu 06 Apr 2017 08:29:16 by <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> 5.3.4.</div>
85+
<div id='footer-content' style='display: none'>Generated on Tue 12 Sep 2017 09:46:17 by <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> 5.3.4.</div>
8686

8787

8888

docs/api/output/Autolinker.matcher.Email.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)