mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
Wrap withinString in try/catch
This commit is contained in:
parent
0d6ff2535e
commit
9a8c1b2fd0
1 changed files with 33 additions and 29 deletions
|
@ -22,6 +22,7 @@ function findLinks(text) {
|
|||
// <a>-Tags.
|
||||
// See https://medialize.github.io/URI.js/docs.html#static-withinString
|
||||
// In our case, we store each URI encountered in a result array.
|
||||
try {
|
||||
URI.withinString(text, function(url, start, end) {
|
||||
let parsedScheme;
|
||||
|
||||
|
@ -57,6 +58,9 @@ function findLinks(text) {
|
|||
link: url
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
// withinString is wrapped in a try/catch due to https://github.com/medialize/URI.js/issues/359
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue