You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe URI's regex for extracting URIs suffers from "catastrophic backtracking" (http://www.regular-expressions.info/catastrophic.html). Here's a repro case (runs in Node). I've also been able to reproduce the slowness in Chrome.
I wonder if we shouldn't just use /\b(?:([a-z][\w-]+:\/\/)|www\.)[^\s]+/gi to find URLs, possibly containing trailing characters (closing brackets, dots, commas, …), and fix that in the replace() callback in withinString().
I believe URI's regex for extracting URIs suffers from "catastrophic backtracking" (http://www.regular-expressions.info/catastrophic.html). Here's a repro case (runs in Node). I've also been able to reproduce the slowness in Chrome.
var URI = require("URIjs");
var input = "background-image:url('http://example.com/my/long/path/to/an/image.png')";
URI.withinString(input, function(u) { console.log(u); });
The text was updated successfully, but these errors were encountered: