Wrap withinString in try/catch
This commit is contained in:
parent
0d6ff2535e
commit
9a8c1b2fd0
@ -22,6 +22,7 @@ function findLinks(text) {
|
|||||||
// <a>-Tags.
|
// <a>-Tags.
|
||||||
// See https://medialize.github.io/URI.js/docs.html#static-withinString
|
// See https://medialize.github.io/URI.js/docs.html#static-withinString
|
||||||
// In our case, we store each URI encountered in a result array.
|
// In our case, we store each URI encountered in a result array.
|
||||||
|
try {
|
||||||
URI.withinString(text, function(url, start, end) {
|
URI.withinString(text, function(url, start, end) {
|
||||||
let parsedScheme;
|
let parsedScheme;
|
||||||
|
|
||||||
@ -57,6 +58,9 @@ function findLinks(text) {
|
|||||||
link: url
|
link: url
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
// withinString is wrapped in a try/catch due to https://github.com/medialize/URI.js/issues/359
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user