docs: fix changelogs

This commit is contained in:
Bereket Engida
2024-12-30 21:58:54 +03:00
parent 34f4b7e3e0
commit cc94e6a7c0

View File

@@ -47,13 +47,16 @@ const ChangelogPage = async () => {
const mainContent = line.split(";")[0]; const mainContent = line.split(";")[0];
const context = line.split(";")[2]; const context = line.split(";")[2];
const mentions = context const mentions = context
.split(" ") ?.split(" ")
.filter((word) => word.startsWith("@")) .filter((word) => word.startsWith("@"))
.map((mention) => { .map((mention) => {
const username = mention.replace("@", ""); const username = mention.replace("@", "");
const avatarUrl = `https://github.com/${username}.png`; const avatarUrl = `https://github.com/${username}.png`;
return `[![${mention}](${avatarUrl})](https://github.com/${username})`; return `[![${mention}](${avatarUrl})](https://github.com/${username})`;
}); });
if (!mentions) {
return line;
}
// Remove &nbsp // Remove &nbsp
return mainContent.replace(/&nbsp/g, "") + " " + mentions.join(" "); return mainContent.replace(/&nbsp/g, "") + " " + mentions.join(" ");
} }