Alright, so I have a link using my custom syntax. This is part of my parser (sans the XSS scrubber part), and it’s the problematic one that I’ve isolated one of the remaining bugs in. For some reason, the URI http://ur.i is getting truncated to merely "i".
Anyone who knows why gets a pony.
var str = "[inner -> http://ur.i]";
str = str.replace(/\[([^\]]+?)\s*(\||->)\s*((?!->)[^\]])+]/g, function(m, iH, separator, hr){
console.log('hr: '); console.log(hr);
return '<a class="'+ (separator.match(/->/) ? 'adlns-btn' : 'adlns-link') +'" href="'+ hr +'">' +
iH +
'</a>';
});
console.log(str);
The
+quantifier should be inside the parentheses, not outside:This solves the problem.