0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-22 11:15:14 +00:00

refactor(description): Fixing some bugs in displaying description.

This commit is contained in:
Georgiy 2023-05-26 18:48:47 +03:00
parent 1fdf1510a6
commit b16cfb7fa5

View file

@ -89,18 +89,18 @@ export default {
text[1].indexOf("/channel/") > -1 || text[1].indexOf("/channel/") > -1 ||
text[1].indexOf("youtube.com/c/") > -1 text[1].indexOf("youtube.com/c/") > -1
) { ) {
let nameOfUrl = text[0].replace(/   /, " "); let nameOfUrl = text[0].replace(/   /, " ").replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
// let newUrl =
// "<a" + ' onclick=openInternal("' + text[1] + '") style="background-color: rgba(0,0,0,0.051); border-radius: 8px; white-space: nowrap;">' + img + nameOfUrl + "</a>";
// Temporary
let newUrl = let newUrl =
"<a" + "<a" +
' onclick=openInternal("channel") style="background-color: rgba(0,0,0,0.051); border-radius: 8px; white-space: nowrap;">' + ' onclick=openInternal("channel") style="background-color: rgba(0,0,0,0.051); border-radius: 8px; white-space: nowrap;">' +
img + img +
nameOfUrl + nameOfUrl +
"</a>"; "</a>";
tempContent = tempContent.replaceAll(text[0], newUrl); tempContent = tempContent.replaceAll(
new RegExp(`\\b${text[0]}\\b`, "g"),
newUrl
);
} else { } else {
let params = new Proxy(new URLSearchParams(text[1]), { let params = new Proxy(new URLSearchParams(text[1]), {
get: (searchParams, prop) => searchParams.get(prop), get: (searchParams, prop) => searchParams.get(prop),