lib/linksoup.js
function makeFuncAsciiDomainReplace(ctx) {
		return function (asciiDomain) {
			var asciiStartPosition = ctx.domain.indexOf(asciiDomain, ctx.asciiEndPosition);
			ctx.asciiEndPosition = asciiStartPosition + asciiDomain.length;
			ctx.lastLink = {
				href : asciiDomain,
				start: ctx.cursor.start + asciiStartPosition,
				end: ctx.cursor.start + ctx.asciiEndPosition
			};
			ctx.lastLinkInvalidMatch = asciiDomain.match(regexen.invalidShortDomain);
			if (!ctx.lastLinkInvalidMatch) {
				ctx.links.push(ctx.lastLink);
			}
		};
	}
function makeFuncAsciiDomainReplace(ctx) {
		return function (asciiDomain) {
			var asciiStartPosition = ctx.domain.indexOf(asciiDomain, ctx.asciiEndPosition);
			ctx.asciiEndPosition = asciiStartPosition + asciiDomain.length;
			ctx.lastLink = {
				href : asciiDomain,
				start: ctx.cursor.start + asciiStartPosition,
				end: ctx.cursor.start + ctx.asciiEndPosition
			};
			ctx.lastLinkInvalidMatch = asciiDomain.match(regexen.invalidShortDomain);
			if (!ctx.lastLinkInvalidMatch) {
				ctx.links.push(ctx.lastLink);
			}
		};
	}
function makeFuncAsciiDomainReplace ( ctx ) { return function ( asciiDomain ) { var asciiStartPosition = ctx . domain . indexOf ( asciiDomain , ctx . asciiEndPosition ) ; ctx . asciiEndPosition = asciiStartPosition + asciiDomain . length ; ctx . lastLink = { href : asciiDomain , start : ctx . cursor . start + asciiStartPosition , end : ctx . cursor . start + ctx . asciiEndPosition } ; ctx . lastLinkInvalidMatch = asciiDomain . match ( regexen . invalidShortDomain ) ; if ( ! ctx . lastLinkInvalidMatch ) { ctx . links . push ( ctx . lastLink ) ; } } ; }
return a closure to handle a custom ascii domain replace
return a closure to handle a custom ascii domain replace