Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

Commit

Permalink
Update comments.html
Browse files Browse the repository at this point in the history
  • Loading branch information
lgor360 authored Jan 9, 2025
1 parent fb88af9 commit 3ae0009
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@
text = text.replace(/^(#+)\s*(.+)$/gm, (_, hashes, content) => `<h${hashes.length}>${content}</h${hashes.length}>`);
return text;
}

function getInstanceFromActorId(actorId)
const url = new URL(actorId);
return url.hostname; // возвращает домен, например, "lemmy.world"
}

// функция для отображения постов
function renderPost(post_view) {
Expand All @@ -183,6 +188,8 @@
${post_view.creator.name}
<div class="community">
${post_view.community.name}
@
${getInstanceFromActorId(post_view.community.actor_id)}
</div>
</div>
</div>
Expand Down

0 comments on commit 3ae0009

Please sign in to comment.