Add IP addresses to linkify

Fixes #91
This commit is contained in:
Daniel Imms
2016-06-07 22:12:38 -07:00
parent 637c2eae43
commit 23cfa3d824
+4 -3
View File
@@ -30,8 +30,10 @@
negatedDomainCharacterSet = '[^\\da-z\\.-]+',
domainBodyClause = '(' + domainCharacterSet + ')',
tldClause = '([a-z\\.]{2,6})',
hostClause = domainBodyClause + '\\.' + tldClause,
pathClause = '([\\/\\w\\.-]*)*\\/?',
ipClause = '((\\d{1,3}\\.){3}\\d{1,3})',
portClause = '(:\\d{1,5})',
hostClause = '((' + domainBodyClause + '\\.' + tldClause + ')|(' + ipClause + portClause + '?))',
pathClause = '(\\/[\\/\\w\\.-]*)*',
negatedPathCharacterSet = '[^\\/\\w\\.-]+',
bodyClause = hostClause + pathClause,
start = '(?:^|' + negatedDomainCharacterSet + ')(',
@@ -41,7 +43,6 @@
lenientUrlRegex = new RegExp(lenientUrlClause),
strictUrlRegex = new RegExp(strictUrlClause);
/**
* Converts all valid URLs found in the given terminal line into
* hyperlinks. The terminal line can be either the HTML element itself