1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-13 22:00:28 +05:30

Fix url replacement.

Closes #1534
This commit is contained in:
Kavin 2022-10-06 09:54:01 +01:00
parent f35dd1c346
commit d6803372f2
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -183,7 +183,7 @@ const mixin = {
const emailRegex = /([\w-\\.]+@(?:[\w-]+\.)+[\w-]{2,4})/g;
return string
.replace(urlRegex, url => {
if (url.endsWith("</a>")) return url;
if (url.endsWith("</a>") || url.endsWith("<a")) return url;
return `<a href="${url}" target="_blank">${url}</a>`;
})
.replace(emailRegex, email => {