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