lib/autolinker.js
function parseUrls(text, options, callback) {
	var urls = [],
		words,
		x = 0,
		i;

	// is a text string
	if (text && utils.isString(text) && text !== '') {

		// break texts into words
		words = [text];
		if (text.indexOf(' ') > -1) {
			words = text.split(' ');
		}

		// finds urls in text
		i = words.length;
		while (x < i) {
			var word = utils.trim(words[x]);

			if (word.indexOf('http:') === 0 || word.indexOf('https:') === 0) {
				urls.push({
					match: word,
					url: word
				});

			} else if (word.indexOf('pic.twitter.com/') === 0) {
				urls.push({
					match: word,
					url: 'https://' + word
				});

			} else if (word.indexOf('vine.co/v/') === 0) {
				urls.push({
					match: word,
					url: 'https://' + word
				});

			}
			x++;
		}

	}
	callback(null, urls);
}
function parseUrls(text, options, callback) {
	var urls = [],
		words,
		x = 0,
		i;

	// is a text string
	if (text && utils.isString(text) && text !== '') {

		// break texts into words
		words = [text];
		if (text.indexOf(' ') > -1) {
			words = text.split(' ');
		}

		// finds urls in text
		i = words.length;
		while (x < i) {
			var word = utils.trim(words[x]);

			if (word.indexOf('http:') === 0 || word.indexOf('https:') === 0) {
				urls.push({
					match: word,
					url: word
				});

			} else if (word.indexOf('pic.twitter.com/') === 0) {
				urls.push({
					match: word,
					url: 'https://' + word
				});

			} else if (word.indexOf('vine.co/v/') === 0) {
				urls.push({
					match: word,
					url: 'https://' + word
				});

			}
			x++;
		}

	}
	callback(null, urls);
}
function parseUrls ( text , options , callback ) { var urls = [ ] , words , x = 0 , i ; // is a text string if ( text && utils . isString ( text ) && text !== '' ) { // break texts into words words = [ text ] ; if ( text . indexOf ( ' ' ) > - 1 ) { words = text . split ( ' ' ) ; } // finds urls in text i = words . length ; while ( x < i ) { var word = utils . trim ( words [ x ] ) ; if ( word . indexOf ( 'http:' ) === 0 || word . indexOf ( 'https:' ) === 0 ) { urls . push ( { match : word , url : word } ) ; } else if ( word . indexOf ( 'pic.twitter.com/' ) === 0 ) { urls . push ( { match : word , url : 'https://' + word } ) ; } else if ( word . indexOf ( 'vine.co/v/' ) === 0 ) { urls . push ( { match : word , url : 'https://' + word } ) ; } x ++ ; } } callback ( null , urls ) ; }
parse the text for urls
parse the text for urls