linkifyjs
Advanced tools
Comparing version 2.0.0-beta.4 to 2.0.0-beta.5
@@ -99,5 +99,5 @@ /** | ||
if (element.tagName === 'A' /*|| element.hasClass('linkified')*/) { | ||
// No need to linkify | ||
return element; | ||
} | ||
// No need to linkify | ||
return element; | ||
} | ||
@@ -115,3 +115,3 @@ var childElement = element.firstChild; | ||
var str = childElement.nodeValue, | ||
tokens = (0, _linkify.tokenize)(str), | ||
tokens = _linkify.tokenize(str), | ||
nodes = tokensToNodes(tokens, opts, doc); | ||
@@ -135,7 +135,7 @@ | ||
function linkifyElement(element, opts) { | ||
var doc = arguments[2] === undefined ? null : arguments[2]; | ||
var doc = arguments.length <= 2 || arguments[2] === undefined ? null : arguments[2]; | ||
try { | ||
doc = doc || window && window.document || global && global.document; | ||
} catch (e) {} | ||
} catch (e) {/* do nothing for now */} | ||
@@ -155,3 +155,2 @@ if (!doc) { | ||
exports['default'] = linkifyElement; | ||
module.exports = exports['default']; | ||
/* do nothing for now */ | ||
module.exports = exports['default']; |
@@ -25,3 +25,3 @@ 'use strict'; | ||
function apply($) { | ||
var doc = arguments[1] === undefined ? null : arguments[1]; | ||
var doc = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; | ||
@@ -32,3 +32,3 @@ $.fn = $.fn || {}; | ||
doc = doc || window && window.document || global && global.document; | ||
} catch (e) {} | ||
} catch (e) {/* do nothing for now */} | ||
@@ -84,3 +84,2 @@ if (!doc) { | ||
exports['default'] = apply; | ||
module.exports = exports['default']; | ||
/* do nothing for now */ | ||
module.exports = exports['default']; |
@@ -26,3 +26,3 @@ /** | ||
var val = (attributes[attr] + '').replace(/"/g, '"'); | ||
result.push('' + attr + '="' + cleanAttr(val) + '"'); | ||
result.push(attr + '="' + cleanAttr(val) + '"'); | ||
} | ||
@@ -33,7 +33,7 @@ return result.join(' '); | ||
function linkifyStr(str) { | ||
var opts = arguments[1] === undefined ? {} : arguments[1]; | ||
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
opts = _linkify.options.normalize(opts); | ||
var tokens = (0, _linkify.tokenize)(str), | ||
var tokens = _linkify.tokenize(str), | ||
result = []; | ||
@@ -40,0 +40,0 @@ |
@@ -39,3 +39,3 @@ 'use strict'; | ||
var find = function find(str) { | ||
var type = arguments[1] === undefined ? null : arguments[1]; | ||
var type = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; | ||
@@ -68,3 +68,3 @@ var tokens = tokenize(str), | ||
var test = function test(str) { | ||
var type = arguments[1] === undefined ? null : arguments[1]; | ||
var type = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; | ||
@@ -71,0 +71,0 @@ var tokens = tokenize(str); |
@@ -18,3 +18,3 @@ /** | ||
var tlds = 'abogado|ac|academy|accountants|active|actor|ad|adult|ae|aero|af|ag|agency|ai|airforce|al|allfinanz|alsace|am|an|android|ao|aq|aquarelle|ar|archi|army|arpa|as|asia|associates|at|attorney|au|auction|audio|autos|aw|ax|axa|az|ba|band|bar|bargains|bayern|bb|bd|be|beer|berlin|best|bf|bg|bh|bi|bid|bike|bio|biz|bj|black|blackfriday|bloomberg|blue|bm|bmw|bn|bnpparibas|bo|boo|boutique|br|brussels|bs|bt|budapest|build|builders|business|buzz|bv|bw|by|bz|bzh|ca|cab|cal|camera|camp|cancerresearch|capetown|capital|caravan|cards|care|career|careers|casa|cash|cat|catering|cc|cd|center|ceo|cern|cf|cg|ch|channel|cheap|christmas|chrome|church|ci|citic|city|ck|cl|claims|cleaning|click|clinic|clothing|club|cm|cn|co|coach|codes|coffee|college|cologne|com|community|company|computer|condos|construction|consulting|contractors|cooking|cool|coop|country|cr|credit|creditcard|cricket|crs|cruises|cu|cuisinella|cv|cw|cx|cy|cymru|cz|dad|dance|dating|day|de|deals|degree|delivery|democrat|dental|dentist|desi|diamonds|diet|digital|direct|directory|discount|dj|dk|dm|dnp|do|domains|durban|dvag|dz|eat|ec|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|equipment|er|es|esq|estate|et|eu|eurovision|eus|events|everbank|exchange|expert|exposed|fail|farm|fashion|feedback|fi|finance|financial|firmdale|fish|fishing|fitness|fj|fk|flights|florist|flsmidth|fly|fm|fo|foo|forsale|foundation|fr|frl|frogans|fund|furniture|futbol|ga|gal|gallery|gb|gbiz|gd|ge|gent|gf|gg|gh|gi|gift|gifts|gives|gl|glass|gle|global|globo|gm|gmail|gmo|gmx|gn|google|gop|gov|gp|gq|gr|graphics|gratis|green|gripe|gs|gt|gu|guide|guitars|guru|gw|gy|hamburg|haus|healthcare|help|here|hiphop|hiv|hk|hm|hn|holdings|holiday|homes|horse|host|hosting|house|how|hr|ht|hu|ibm|id|ie|il|im|immo|immobilien|in|industries|info|ing|ink|institute|insure|int|international|investments|io|iq|ir|irish|is|it|je|jetzt|jm|jo|jobs|joburg|jp|juegos|kaufen|ke|kg|kh|ki|kim|kitchen|kiwi|km|kn|koeln|kp|kr|krd|kred|kw|ky|kz|la|lacaixa|land|latrobe|lawyer|lb|lc|lds|lease|legal|lgbt|li|life|lighting|limited|limo|link|lk|loans|london|lotto|lr|ls|lt|ltda|lu|luxe|luxury|lv|ly|ma|madrid|maison|management|mango|market|marketing|mc|md|me|media|meet|melbourne|meme|memorial|menu|mg|mh|miami|mil|mini|mk|ml|mm|mn|mo|mobi|moda|moe|monash|money|mormon|mortgage|moscow|motorcycles|mov|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|nagoya|name|navy|nc|ne|net|network|neustar|new|nexus|nf|ng|ngo|nhk|ni|ninja|nl|no|np|nr|nra|nrw|nu|nyc|nz|okinawa|om|ong|onl|ooo|org|organic|otsuka|ovh|pa|paris|partners|parts|party|pe|pf|pg|ph|pharmacy|photo|photography|photos|physio|pics|pictures|pink|pizza|pk|pl|place|plumbing|pm|pn|pohl|poker|porn|post|pr|praxi|press|pro|prod|productions|prof|properties|property|ps|pt|pub|pw|py|qa|qpon|quebec|re|realtor|recipes|red|rehab|reise|reisen|reit|ren|rentals|repair|report|republican|rest|restaurant|reviews|rich|rio|rip|ro|rocks|rodeo|rs|rsvp|ru|ruhr|rw|ryukyu|sa|saarland|sarl|sb|sc|sca|scb|schmidt|schule|science|scot|sd|se|services|sexy|sg|sh|shiksha|shoes|si|singles|sj|sk|sl|sm|sn|so|social|software|sohu|solar|solutions|soy|space|spiegel|sr|st|su|supplies|supply|support|surf|surgery|suzuki|sv|sx|sy|sydney|systems|sz|taipei|tatar|tattoo|tax|tc|td|technology|tel|tf|tg|th|tienda|tips|tirol|tj|tk|tl|tm|tn|to|today|tokyo|tools|top|town|toys|tp|tr|trade|training|travel|trust|tt|tui|tv|tw|tz|ua|ug|uk|university|uno|uol|us|uy|uz|va|vacations|vc|ve|vegas|ventures|versicherung|vet|vg|vi|viajes|villas|vision|vlaanderen|vn|vodka|vote|voting|voto|voyage|vu|wales|wang|watch|webcam|website|wed|wedding|wf|whoswho|wien|wiki|williamhill|wme|work|works|world|ws|wtc|wtf|xxx|xyz|yachts|yandex|ye|yoga|yokohama|youtube|yt|za|zip|zm|zone|zw'.split('|'); // macro, see gulpfile.js | ||
var tlds = "abogado|ac|academy|accountants|active|actor|ad|adult|ae|aero|af|ag|agency|ai|airforce|al|allfinanz|alsace|am|an|android|ao|aq|aquarelle|ar|archi|army|arpa|as|asia|associates|at|attorney|au|auction|audio|autos|aw|ax|axa|az|ba|band|bar|bargains|bayern|bb|bd|be|beer|berlin|best|bf|bg|bh|bi|bid|bike|bio|biz|bj|black|blackfriday|bloomberg|blue|bm|bmw|bn|bnpparibas|bo|boo|boutique|br|brussels|bs|bt|budapest|build|builders|business|buzz|bv|bw|by|bz|bzh|ca|cab|cal|camera|camp|cancerresearch|capetown|capital|caravan|cards|care|career|careers|casa|cash|cat|catering|cc|cd|center|ceo|cern|cf|cg|ch|channel|cheap|christmas|chrome|church|ci|citic|city|ck|cl|claims|cleaning|click|clinic|clothing|club|cm|cn|co|coach|codes|coffee|college|cologne|com|community|company|computer|condos|construction|consulting|contractors|cooking|cool|coop|country|cr|credit|creditcard|cricket|crs|cruises|cu|cuisinella|cv|cw|cx|cy|cymru|cz|dad|dance|dating|day|de|deals|degree|delivery|democrat|dental|dentist|desi|diamonds|diet|digital|direct|directory|discount|dj|dk|dm|dnp|do|domains|durban|dvag|dz|eat|ec|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|equipment|er|es|esq|estate|et|eu|eurovision|eus|events|everbank|exchange|expert|exposed|fail|farm|fashion|feedback|fi|finance|financial|firmdale|fish|fishing|fitness|fj|fk|flights|florist|flsmidth|fly|fm|fo|foo|forsale|foundation|fr|frl|frogans|fund|furniture|futbol|ga|gal|gallery|gb|gbiz|gd|ge|gent|gf|gg|gh|gi|gift|gifts|gives|gl|glass|gle|global|globo|gm|gmail|gmo|gmx|gn|google|gop|gov|gp|gq|gr|graphics|gratis|green|gripe|gs|gt|gu|guide|guitars|guru|gw|gy|hamburg|haus|healthcare|help|here|hiphop|hiv|hk|hm|hn|holdings|holiday|homes|horse|host|hosting|house|how|hr|ht|hu|ibm|id|ie|il|im|immo|immobilien|in|industries|info|ing|ink|institute|insure|int|international|investments|io|iq|ir|irish|is|it|je|jetzt|jm|jo|jobs|joburg|jp|juegos|kaufen|ke|kg|kh|ki|kim|kitchen|kiwi|km|kn|koeln|kp|kr|krd|kred|kw|ky|kz|la|lacaixa|land|latrobe|lawyer|lb|lc|lds|lease|legal|lgbt|li|life|lighting|limited|limo|link|lk|loans|london|lotto|lr|ls|lt|ltda|lu|luxe|luxury|lv|ly|ma|madrid|maison|management|mango|market|marketing|mc|md|me|media|meet|melbourne|meme|memorial|menu|mg|mh|miami|mil|mini|mk|ml|mm|mn|mo|mobi|moda|moe|monash|money|mormon|mortgage|moscow|motorcycles|mov|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|nagoya|name|navy|nc|ne|net|network|neustar|new|nexus|nf|ng|ngo|nhk|ni|ninja|nl|no|np|nr|nra|nrw|nu|nyc|nz|okinawa|om|ong|onl|ooo|org|organic|otsuka|ovh|pa|paris|partners|parts|party|pe|pf|pg|ph|pharmacy|photo|photography|photos|physio|pics|pictures|pink|pizza|pk|pl|place|plumbing|pm|pn|pohl|poker|porn|post|pr|praxi|press|pro|prod|productions|prof|properties|property|ps|pt|pub|pw|py|qa|qpon|quebec|re|realtor|recipes|red|rehab|reise|reisen|reit|ren|rentals|repair|report|republican|rest|restaurant|reviews|rich|rio|rip|ro|rocks|rodeo|rs|rsvp|ru|ruhr|rw|ryukyu|sa|saarland|sarl|sb|sc|sca|scb|schmidt|schule|science|scot|sd|se|services|sexy|sg|sh|shiksha|shoes|si|singles|sj|sk|sl|sm|sn|so|social|software|sohu|solar|solutions|soy|space|spiegel|sr|st|su|supplies|supply|support|surf|surgery|suzuki|sv|sx|sy|sydney|systems|sz|taipei|tatar|tattoo|tax|tc|td|technology|tel|tf|tg|th|tienda|tips|tirol|tj|tk|tl|tm|tn|to|today|tokyo|tools|top|town|toys|tp|tr|trade|training|travel|trust|tt|tui|tv|tw|tz|ua|ug|uk|university|uno|uol|us|uy|uz|va|vacations|vc|ve|vegas|ventures|versicherung|vet|vg|vi|viajes|villas|vision|vlaanderen|vn|vodka|vote|voting|voto|voyage|vu|wales|wang|watch|webcam|website|wed|wedding|wf|whoswho|wien|wiki|williamhill|wme|work|works|world|ws|wtc|wtf|xxx|xyz|yachts|yandex|ye|yoga|yokohama|youtube|yt|za|zip|zm|zone|zw".split("|"); // macro, see gulpfile.js | ||
@@ -67,3 +67,3 @@ var REGEXP_NUM = /[0-9]/, | ||
for (var i = 0; i < tlds.length; i++) { | ||
var newStates = (0, _state.stateify)(tlds[i], S_START, T_TLD, T_DOMAIN); | ||
var newStates = _state.stateify(tlds[i], S_START, T_TLD, T_DOMAIN); | ||
domainStates.push.apply(domainStates, newStates); | ||
@@ -73,5 +73,5 @@ } | ||
// Collect the states generated by different protocls | ||
var partialProtocolFileStates = (0, _state.stateify)('file', S_START, T_DOMAIN, T_DOMAIN), | ||
partialProtocolFtpStates = (0, _state.stateify)('ftp', S_START, T_DOMAIN, T_DOMAIN), | ||
partialProtocolHttpStates = (0, _state.stateify)('http', S_START, T_DOMAIN, T_DOMAIN); | ||
var partialProtocolFileStates = _state.stateify('file', S_START, T_DOMAIN, T_DOMAIN), | ||
partialProtocolFtpStates = _state.stateify('ftp', S_START, T_DOMAIN, T_DOMAIN), | ||
partialProtocolHttpStates = _state.stateify('http', S_START, T_DOMAIN, T_DOMAIN); | ||
@@ -102,3 +102,3 @@ // Add the states to the array of DOMAINeric states | ||
// Localhost | ||
var partialLocalhostStates = (0, _state.stateify)('localhost', S_START, T_LOCALHOST, T_DOMAIN); | ||
var partialLocalhostStates = _state.stateify('localhost', S_START, T_LOCALHOST, T_DOMAIN); | ||
domainStates.push.apply(domainStates, partialLocalhostStates); | ||
@@ -139,8 +139,14 @@ | ||
var lowerStr = str.toLowerCase(), | ||
// The state machine only looks at lowercase strings | ||
len = str.length, | ||
cursor = 0, | ||
tokens = []; // return value | ||
// The state machine only looks at lowercase strings. | ||
// This selective `toLowerCase` is used because lowercasing the entire | ||
// string causes the length and character position to vary in some in some | ||
// non-English strings. This happens only on V8-based runtimes. | ||
var lowerStr = str.replace(/[A-Z]/g, function (c) { | ||
return c.toLowerCase(); | ||
}); | ||
var len = str.length; | ||
var tokens = []; // return value | ||
var cursor = 0; | ||
// Tokenize the string | ||
@@ -147,0 +153,0 @@ while (cursor < len) { |
@@ -25,3 +25,3 @@ | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -46,2 +46,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
/** | ||
State machine for string-based input | ||
@class CharacterState | ||
@extends BaseState | ||
*/ | ||
/** | ||
On the given symbol(s), this machine should go to the given state | ||
@@ -129,19 +136,17 @@ @method on | ||
/** | ||
State machine for string-based input | ||
var CharacterState = (function (_BaseState) { | ||
_inherits(CharacterState, _BaseState); | ||
@class CharacterState | ||
@extends BaseState | ||
*/ | ||
var CharacterState = (function (_BaseState) { | ||
function CharacterState() { | ||
_classCallCheck(this, CharacterState); | ||
if (_BaseState != null) { | ||
_BaseState.apply(this, arguments); | ||
} | ||
_BaseState.apply(this, arguments); | ||
} | ||
_inherits(CharacterState, _BaseState); | ||
/** | ||
State machine for input in the form of TextTokens | ||
@class TokenState | ||
@extends BaseState | ||
*/ | ||
@@ -164,19 +169,31 @@ /** | ||
/** | ||
State machine for input in the form of TextTokens | ||
var TokenState = (function (_BaseState2) { | ||
_inherits(TokenState, _BaseState2); | ||
@class TokenState | ||
@extends BaseState | ||
*/ | ||
var TokenState = (function (_BaseState2) { | ||
function TokenState() { | ||
_classCallCheck(this, TokenState); | ||
if (_BaseState2 != null) { | ||
_BaseState2.apply(this, arguments); | ||
} | ||
_BaseState2.apply(this, arguments); | ||
} | ||
_inherits(TokenState, _BaseState2); | ||
/** | ||
Given a non-empty target string, generates states (if required) for each | ||
consecutive substring of characters in str starting from the beginning of | ||
the string. The final state will have a special value, as specified in | ||
options. All other "in between" substrings will have a default end state. | ||
This turns the state machine into a Trie-like data structure (rather than a | ||
intelligently-designed DFA). | ||
Note that I haven't really tried these with any strings other than | ||
DOMAIN. | ||
@param {String} str | ||
@param {CharacterState} start State to jump from the first character | ||
@param {Class} endToken Token class to emit when the given string has been | ||
matched and no more jumps exist. | ||
@param {Class} defaultToken "Filler token", or which token type to emit when | ||
we don't have a full match | ||
@return {Array} list of newly-created states | ||
*/ | ||
@@ -198,22 +215,2 @@ /** | ||
/** | ||
Given a non-empty target string, generates states (if required) for each | ||
consecutive substring of characters in str starting from the beginning of | ||
the string. The final state will have a special value, as specified in | ||
options. All other "in between" substrings will have a default end state. | ||
This turns the state machine into a Trie-like data structure (rather than a | ||
intelligently-designed DFA). | ||
Note that I haven't really tried these with any strings other than | ||
DOMAIN. | ||
@param {String} str | ||
@param {CharacterState} start State to jump from the first character | ||
@param {Class} endToken Token class to emit when the given string has been | ||
matched and no more jumps exist. | ||
@param {Class} defaultToken "Filler token", or which token type to emit when | ||
we don't have a full match | ||
@return {Array} list of newly-created states | ||
*/ | ||
function stateify(str, start, endToken, defaultToken) { | ||
@@ -220,0 +217,0 @@ |
@@ -17,3 +17,3 @@ /****************************************************************************** | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -35,2 +35,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
/** | ||
A valid domain token | ||
@class DOMAIN | ||
@extends TextToken | ||
*/ | ||
/** | ||
String representing the type for this token | ||
@@ -48,28 +54,21 @@ @property type | ||
/** | ||
A valid domain token | ||
@class DOMAIN | ||
@extends TextToken | ||
*/ | ||
var DOMAIN = (function (_TextToken) { | ||
_inherits(DOMAIN, _TextToken); | ||
var DOMAIN = (function (_TextToken) { | ||
function DOMAIN() { | ||
_classCallCheck(this, DOMAIN); | ||
if (_TextToken != null) { | ||
_TextToken.apply(this, arguments); | ||
} | ||
_TextToken.apply(this, arguments); | ||
} | ||
_inherits(DOMAIN, _TextToken); | ||
/** | ||
@class AT | ||
@extends TextToken | ||
*/ | ||
return DOMAIN; | ||
})(TextToken); | ||
/** | ||
@class AT | ||
@extends TextToken | ||
*/ | ||
var AT = (function (_TextToken2) { | ||
_inherits(AT, _TextToken2); | ||
var AT = (function (_TextToken2) { | ||
function AT() { | ||
@@ -81,15 +80,14 @@ _classCallCheck(this, AT); | ||
_inherits(AT, _TextToken2); | ||
/** | ||
Represents a single colon `:` character | ||
@class COLON | ||
@extends TextToken | ||
*/ | ||
return AT; | ||
})(TextToken); | ||
/** | ||
Represents a single colon `:` character | ||
var COLON = (function (_TextToken3) { | ||
_inherits(COLON, _TextToken3); | ||
@class COLON | ||
@extends TextToken | ||
*/ | ||
var COLON = (function (_TextToken3) { | ||
function COLON() { | ||
@@ -101,13 +99,12 @@ _classCallCheck(this, COLON); | ||
_inherits(COLON, _TextToken3); | ||
/** | ||
@class DOT | ||
@extends TextToken | ||
*/ | ||
return COLON; | ||
})(TextToken); | ||
/** | ||
@class DOT | ||
@extends TextToken | ||
*/ | ||
var DOT = (function (_TextToken4) { | ||
_inherits(DOT, _TextToken4); | ||
var DOT = (function (_TextToken4) { | ||
function DOT() { | ||
@@ -119,56 +116,49 @@ _classCallCheck(this, DOT); | ||
_inherits(DOT, _TextToken4); | ||
/** | ||
A character class that can surround the URL, but which the URL cannot begin | ||
or end with. Does not include certain English punctuation like parentheses. | ||
@class PUNCTUATION | ||
@extends TextToken | ||
*/ | ||
return DOT; | ||
})(TextToken); | ||
/** | ||
A character class that can surround the URL, but which the URL cannot begin | ||
or end with. Does not include certain English punctuation like parentheses. | ||
var PUNCTUATION = (function (_TextToken5) { | ||
_inherits(PUNCTUATION, _TextToken5); | ||
@class PUNCTUATION | ||
@extends TextToken | ||
*/ | ||
var PUNCTUATION = (function (_TextToken5) { | ||
function PUNCTUATION() { | ||
_classCallCheck(this, PUNCTUATION); | ||
if (_TextToken5 != null) { | ||
_TextToken5.apply(this, arguments); | ||
} | ||
_TextToken5.apply(this, arguments); | ||
} | ||
_inherits(PUNCTUATION, _TextToken5); | ||
/** | ||
The word localhost (by itself) | ||
@class LOCALHOST | ||
@extends TextToken | ||
*/ | ||
return PUNCTUATION; | ||
})(TextToken); | ||
/** | ||
The word localhost (by itself) | ||
@class LOCALHOST | ||
@extends TextToken | ||
*/ | ||
var LOCALHOST = (function (_TextToken6) { | ||
_inherits(LOCALHOST, _TextToken6); | ||
var LOCALHOST = (function (_TextToken6) { | ||
function LOCALHOST() { | ||
_classCallCheck(this, LOCALHOST); | ||
if (_TextToken6 != null) { | ||
_TextToken6.apply(this, arguments); | ||
} | ||
_TextToken6.apply(this, arguments); | ||
} | ||
_inherits(LOCALHOST, _TextToken6); | ||
/** | ||
Newline token | ||
@class TNL | ||
@extends TextToken | ||
*/ | ||
return LOCALHOST; | ||
})(TextToken); | ||
/** | ||
Newline token | ||
@class TNL | ||
@extends TextToken | ||
*/ | ||
var TNL = (function (_TextToken7) { | ||
_inherits(TNL, _TextToken7); | ||
var TNL = (function (_TextToken7) { | ||
function TNL() { | ||
@@ -180,32 +170,28 @@ _classCallCheck(this, TNL); | ||
_inherits(TNL, _TextToken7); | ||
/** | ||
@class NUM | ||
@extends TextToken | ||
*/ | ||
return TNL; | ||
})(TextToken); | ||
/** | ||
@class NUM | ||
@extends TextToken | ||
*/ | ||
var NUM = (function (_TextToken8) { | ||
_inherits(NUM, _TextToken8); | ||
var NUM = (function (_TextToken8) { | ||
function NUM() { | ||
_classCallCheck(this, NUM); | ||
if (_TextToken8 != null) { | ||
_TextToken8.apply(this, arguments); | ||
} | ||
_TextToken8.apply(this, arguments); | ||
} | ||
_inherits(NUM, _TextToken8); | ||
/** | ||
@class PLUS | ||
@extends TextToken | ||
*/ | ||
return NUM; | ||
})(TextToken); | ||
/** | ||
@class PLUS | ||
@extends TextToken | ||
*/ | ||
var PLUS = (function (_TextToken9) { | ||
_inherits(PLUS, _TextToken9); | ||
var PLUS = (function (_TextToken9) { | ||
function PLUS() { | ||
@@ -217,13 +203,12 @@ _classCallCheck(this, PLUS); | ||
_inherits(PLUS, _TextToken9); | ||
/** | ||
@class POUND | ||
@extends TextToken | ||
*/ | ||
return PLUS; | ||
})(TextToken); | ||
/** | ||
@class POUND | ||
@extends TextToken | ||
*/ | ||
var POUND = (function (_TextToken10) { | ||
_inherits(POUND, _TextToken10); | ||
var POUND = (function (_TextToken10) { | ||
function POUND() { | ||
@@ -235,40 +220,36 @@ _classCallCheck(this, POUND); | ||
_inherits(POUND, _TextToken10); | ||
/** | ||
Represents a web URL protocol. Supported types include | ||
* `http:` | ||
* `https:` | ||
* `ftp:` | ||
* `ftps:` | ||
* There's Another super weird one | ||
@class PROTOCOL | ||
@extends TextToken | ||
*/ | ||
return POUND; | ||
})(TextToken); | ||
/** | ||
Represents a web URL protocol. Supported types include | ||
var PROTOCOL = (function (_TextToken11) { | ||
_inherits(PROTOCOL, _TextToken11); | ||
* `http:` | ||
* `https:` | ||
* `ftp:` | ||
* `ftps:` | ||
* There's Another super weird one | ||
@class PROTOCOL | ||
@extends TextToken | ||
*/ | ||
var PROTOCOL = (function (_TextToken11) { | ||
function PROTOCOL() { | ||
_classCallCheck(this, PROTOCOL); | ||
if (_TextToken11 != null) { | ||
_TextToken11.apply(this, arguments); | ||
} | ||
_TextToken11.apply(this, arguments); | ||
} | ||
_inherits(PROTOCOL, _TextToken11); | ||
/** | ||
@class QUERY | ||
@extends TextToken | ||
*/ | ||
return PROTOCOL; | ||
})(TextToken); | ||
/** | ||
@class QUERY | ||
@extends TextToken | ||
*/ | ||
var QUERY = (function (_TextToken12) { | ||
_inherits(QUERY, _TextToken12); | ||
var QUERY = (function (_TextToken12) { | ||
function QUERY() { | ||
@@ -280,13 +261,12 @@ _classCallCheck(this, QUERY); | ||
_inherits(QUERY, _TextToken12); | ||
/** | ||
@class SLASH | ||
@extends TextToken | ||
*/ | ||
return QUERY; | ||
})(TextToken); | ||
/** | ||
@class SLASH | ||
@extends TextToken | ||
*/ | ||
var SLASH = (function (_TextToken13) { | ||
_inherits(SLASH, _TextToken13); | ||
var SLASH = (function (_TextToken13) { | ||
function SLASH() { | ||
@@ -298,64 +278,53 @@ _classCallCheck(this, SLASH); | ||
_inherits(SLASH, _TextToken13); | ||
/** | ||
One ore more non-whitespace symbol. | ||
@class SYM | ||
@extends TextToken | ||
*/ | ||
return SLASH; | ||
})(TextToken); | ||
/** | ||
One ore more non-whitespace symbol. | ||
@class SYM | ||
@extends TextToken | ||
*/ | ||
var SYM = (function (_TextToken14) { | ||
_inherits(SYM, _TextToken14); | ||
var SYM = (function (_TextToken14) { | ||
function SYM() { | ||
_classCallCheck(this, SYM); | ||
if (_TextToken14 != null) { | ||
_TextToken14.apply(this, arguments); | ||
} | ||
_TextToken14.apply(this, arguments); | ||
} | ||
_inherits(SYM, _TextToken14); | ||
/** | ||
@class TLD | ||
@extends TextToken | ||
*/ | ||
return SYM; | ||
})(TextToken); | ||
/** | ||
@class TLD | ||
@extends TextToken | ||
*/ | ||
var TLD = (function (_TextToken15) { | ||
_inherits(TLD, _TextToken15); | ||
var TLD = (function (_TextToken15) { | ||
function TLD() { | ||
_classCallCheck(this, TLD); | ||
if (_TextToken15 != null) { | ||
_TextToken15.apply(this, arguments); | ||
} | ||
_TextToken15.apply(this, arguments); | ||
} | ||
_inherits(TLD, _TextToken15); | ||
/** | ||
Represents a string of consecutive whitespace characters | ||
@class WS | ||
@extends TextToken | ||
*/ | ||
return TLD; | ||
})(TextToken); | ||
/** | ||
Represents a string of consecutive whitespace characters | ||
var WS = (function (_TextToken16) { | ||
_inherits(WS, _TextToken16); | ||
@class WS | ||
@extends TextToken | ||
*/ | ||
var WS = (function (_TextToken16) { | ||
function WS() { | ||
_classCallCheck(this, WS); | ||
if (_TextToken16 != null) { | ||
_TextToken16.apply(this, arguments); | ||
} | ||
_TextToken16.apply(this, arguments); | ||
} | ||
_inherits(WS, _TextToken16); | ||
return WS; | ||
@@ -435,2 +404,8 @@ })(TextToken); | ||
/** | ||
Represents a list of tokens making up a valid email address | ||
@class EMAIL | ||
@extends MultiToken | ||
*/ | ||
/** | ||
Return the string this token represents. | ||
@@ -472,3 +447,3 @@ @method toString | ||
MultiToken.prototype.toObject = function toObject() { | ||
var protocol = arguments[0] === undefined ? 'http' : arguments[0]; | ||
var protocol = arguments.length <= 0 || arguments[0] === undefined ? 'http' : arguments[0]; | ||
@@ -485,9 +460,5 @@ return { | ||
/** | ||
Represents a list of tokens making up a valid email address | ||
@class EMAIL | ||
@extends MultiToken | ||
*/ | ||
var EMAIL = (function (_MultiToken) { | ||
_inherits(EMAIL, _MultiToken); | ||
var EMAIL = (function (_MultiToken) { | ||
function EMAIL(value) { | ||
@@ -501,3 +472,7 @@ _classCallCheck(this, EMAIL); | ||
_inherits(EMAIL, _MultiToken); | ||
/** | ||
Represents some plain text | ||
@class TEXT | ||
@extends MultiToken | ||
*/ | ||
@@ -511,9 +486,5 @@ EMAIL.prototype.toHref = function toHref() { | ||
/** | ||
Represents some plain text | ||
@class TEXT | ||
@extends MultiToken | ||
*/ | ||
var TEXT = (function (_MultiToken2) { | ||
_inherits(TEXT, _MultiToken2); | ||
var TEXT = (function (_MultiToken2) { | ||
function TEXT(value) { | ||
@@ -526,14 +497,13 @@ _classCallCheck(this, TEXT); | ||
_inherits(TEXT, _MultiToken2); | ||
/** | ||
Multi-linebreak token - represents a line break | ||
@class MNL | ||
@extends MultiToken | ||
*/ | ||
return TEXT; | ||
})(MultiToken); | ||
/** | ||
Multi-linebreak token - represents a line break | ||
@class MNL | ||
@extends MultiToken | ||
*/ | ||
var MNL = (function (_MultiToken3) { | ||
_inherits(MNL, _MultiToken3); | ||
var MNL = (function (_MultiToken3) { | ||
function MNL(value) { | ||
@@ -546,14 +516,13 @@ _classCallCheck(this, MNL); | ||
_inherits(MNL, _MultiToken3); | ||
/** | ||
Represents a list of tokens making up a valid URL | ||
@class URL | ||
@extends MultiToken | ||
*/ | ||
return MNL; | ||
})(MultiToken); | ||
/** | ||
Represents a list of tokens making up a valid URL | ||
@class URL | ||
@extends MultiToken | ||
*/ | ||
var URL = (function (_MultiToken4) { | ||
_inherits(URL, _MultiToken4); | ||
var URL = (function (_MultiToken4) { | ||
function URL(value) { | ||
@@ -567,4 +536,2 @@ _classCallCheck(this, URL); | ||
_inherits(URL, _MultiToken4); | ||
/** | ||
@@ -580,3 +547,3 @@ Lowercases relevant parts of the domain and adds the protocol if | ||
URL.prototype.toHref = function toHref() { | ||
var protocol = arguments[0] === undefined ? 'http' : arguments[0]; | ||
var protocol = arguments.length <= 0 || arguments[0] === undefined ? 'http' : arguments[0]; | ||
@@ -583,0 +550,0 @@ var hasProtocol = false, |
@@ -10,3 +10,3 @@ /** | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
@@ -24,2 +24,4 @@ function hashtag(linkify) { | ||
var HASHTAG = (function (_MultiToken) { | ||
_inherits(HASHTAG, _MultiToken); | ||
function HASHTAG(value) { | ||
@@ -33,4 +35,2 @@ _classCallCheck(this, HASHTAG); | ||
_inherits(HASHTAG, _MultiToken); | ||
return HASHTAG; | ||
@@ -37,0 +37,0 @@ })(MultiToken); |
{ | ||
"name": "linkifyjs", | ||
"version": "2.0.0-beta.4", | ||
"version": "2.0.0-beta.5", | ||
"description": "Intelligent link recognition, made easy", | ||
@@ -32,35 +32,36 @@ "repository": { | ||
"devDependencies": { | ||
"amd-optimize": "^0.4.3", | ||
"brfs": "^1.4.0", | ||
"closure-compiler": "^0.2.6", | ||
"coveralls": "^2.11.2", | ||
"amd-optimize": "^0.6.1", | ||
"brfs": "^1.4.1", | ||
"closure-compiler": "0.2.6", | ||
"coveralls": "^2.11.4", | ||
"expect.js": "^0.3.1", | ||
"glob": "^5.0.3", | ||
"glob": "^5.0.15", | ||
"gulp": "^3.8.11", | ||
"gulp-babel": "^5.1.0", | ||
"gulp-closure-compiler": "^0.2.14", | ||
"gulp-concat": "^2.5.2", | ||
"gulp-istanbul": "^0.10.0", | ||
"gulp-jshint": "^1.9.2", | ||
"gulp-mocha": "^2.1.0", | ||
"gulp-babel": "^5.3.0", | ||
"gulp-closure-compiler": "^0.3.1", | ||
"gulp-concat": "^2.6.0", | ||
"gulp-istanbul": "^0.10.2", | ||
"gulp-jshint": "^1.12.0", | ||
"gulp-mocha": "^2.1.3", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-replace": "^0.5.3", | ||
"gulp-uglify": "^1.1.0", | ||
"gulp-replace": "^0.5.4", | ||
"gulp-uglify": "^1.4.2", | ||
"gulp-wrap": "^0.11.0", | ||
"jsdom": "^3.0.0", | ||
"jshint-stylish": "^2.0.0", | ||
"karma": "^0.12.32", | ||
"karma-browserify": "^4.0.0", | ||
"karma-chrome-launcher": "^0.1.7", | ||
"jsdom": "^6.5.1", | ||
"jshint-stylish": "^2.0.1", | ||
"karma": "^0.13.15", | ||
"karma-browserify": "^4.4.0", | ||
"karma-chrome-launcher": "^0.2.1", | ||
"karma-firefox-launcher": "^0.1.6", | ||
"karma-mocha": "^0.1.10", | ||
"karma-phantomjs-launcher": "^0.2.0", | ||
"karma-sauce-launcher": "^0.2.10", | ||
"lodash": "^3.9.3", | ||
"merge-stream": "^0.1.7", | ||
"mocha": "^2.2.1" | ||
"karma-mocha": "^0.2.0", | ||
"karma-phantomjs-launcher": "^0.2.1", | ||
"karma-sauce-launcher": "^0.3.0", | ||
"lodash": "^3.10.1", | ||
"merge-stream": "^1.0.0", | ||
"mocha": "^2.3.3", | ||
"phantomjs": "^1.9.18" | ||
}, | ||
"optionalDependencies": { | ||
"jquery": "^1.11.1" | ||
"jquery": ">=1.9.0" | ||
} | ||
} |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
72954
30
2116