mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-23 05:57:21 +00:00
parent
eea4965974
commit
619a1d0d7e
@ -161,10 +161,15 @@ const mixin = {
|
||||
return timeAgo.format(time);
|
||||
},
|
||||
urlify(string) {
|
||||
const regex = /(((https?:\/\/)|(www\.))[^\s]+)/g;
|
||||
if (!string) return "";
|
||||
return string.replace(regex, url => {
|
||||
const urlRegex = /(((https?:\/\/)|(www\.))[^\s]+)/g;
|
||||
const emailRegex = /([\w-\\.]+@(?:[\w-]+\.)+[\w-]{2,4})/g;
|
||||
return string
|
||||
.replace(urlRegex, url => {
|
||||
return `<a href="${url}" target="_blank">${url}</a>`;
|
||||
})
|
||||
.replace(emailRegex, email => {
|
||||
return `<a href="mailto:${email}">${email}</a>`;
|
||||
});
|
||||
},
|
||||
async updateWatched(videos) {
|
||||
|
Loading…
Reference in New Issue
Block a user