mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
fix(hyperlinking): fixed url detection
This commit is contained in:
parent
1a7337a170
commit
5846e90372
1 changed files with 0 additions and 3 deletions
|
@ -162,9 +162,6 @@ const mixin = {
|
||||||
const regex = /(((https?:\/\/)|(www\.))[^\s]+)/g;
|
const regex = /(((https?:\/\/)|(www\.))[^\s]+)/g;
|
||||||
if (!string) return '';
|
if (!string) return '';
|
||||||
return string.replace(regex, (url) => {
|
return string.replace(regex, (url) => {
|
||||||
if (!url.match('^https?:\\/\\/')) { // If URL does not have http(s), we're adding it manually.
|
|
||||||
return `<a class="uk-button uk-button-text" href="http://${url}" target="_blank">${url}</a>`
|
|
||||||
}
|
|
||||||
return `<a class="uk-button uk-button-text" href="${url}" target="_blank">${url}</a>`
|
return `<a class="uk-button uk-button-text" href="${url}" target="_blank">${url}</a>`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue