abyss internal link shortening, removal of # for ids and external preview

This commit is contained in:
2026-05-17 14:16:13 +02:00
parent 832f97970e
commit 82574466ee
5 changed files with 70 additions and 16 deletions

View File

@@ -1668,7 +1668,14 @@ class CommentSystem {
}
);
// Build regex for allowed media hosters (video/audio)
// Abyss label replacement
md = md.replace(
/<a\s[^>]*href="(?:https?:\/\/[^\/]+)?\/abyss(?:#|\/)(\d+)"[^>]*>([\s\S]*?)<\/a>/gi,
(match, abyssId) => {
return `<a href="/abyss/${abyssId}" class="abyss-link" data-abyss-id="${abyssId}"><i class="fa-solid fa-dice-d6"></i> /abyss/${abyssId}</a>`;
}
);
const mediaHosts = [escapedSiteHost];
if (window.f0ckAllowedImages && Array.isArray(window.f0ckAllowedImages)) {
window.f0ckAllowedImages.forEach(h => {