mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-23 22:13:36 +00:00
parent
eea4965974
commit
619a1d0d7e
13
src/main.js
13
src/main.js
@ -161,11 +161,16 @@ const mixin = {
|
||||
return timeAgo.format(time);
|
||||
},
|
||||
urlify(string) {
|
||||
const regex = /(((https?:\/\/)|(www\.))[^\s]+)/g;
|
||||
if (!string) return "";
|
||||
return string.replace(regex, url => {
|
||||
return `<a href="${url}" target="_blank">${url}</a>`;
|
||||
});
|
||||
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) {
|
||||
if (window.db) {
|
||||
|
Loading…
Reference in New Issue
Block a user