From 3ae00099f86868a16d0e09010046deab51c2fcbc Mon Sep 17 00:00:00 2001 From: igor <93474580+lgor360@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:00:37 +0300 Subject: [PATCH] Update comments.html --- comments.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/comments.html b/comments.html index 8e6174b..7c1d236 100644 --- a/comments.html +++ b/comments.html @@ -168,6 +168,11 @@ text = text.replace(/^(#+)\s*(.+)$/gm, (_, hashes, content) => `${content}`); return text; } + + function getInstanceFromActorId(actorId) + const url = new URL(actorId); + return url.hostname; // возвращает домен, например, "lemmy.world" + } // функция для отображения постов function renderPost(post_view) { @@ -183,6 +188,8 @@ ${post_view.creator.name}
${post_view.community.name} + @ + ${getInstanceFromActorId(post_view.community.actor_id)}