summaryrefslogtreecommitdiff
path: root/src/loaders/pleroma.ts
diff options
context:
space:
mode:
authorDawid Rycerz <dawid@rycerz.xyz>2026-01-13 15:31:19 +0100
committerDawid Rycerz <dawid@rycerz.xyz>2026-01-13 15:39:07 +0100
commit52411f6cb9efc10dd683096b34e5c279a11f7e0a (patch)
treefd5e71902fbebe2e3f014c7ebb5f153fc8c7d1e7 /src/loaders/pleroma.ts
parent26ffc44ee72522891b4fdacac15134dfcf9c4859 (diff)
Rework how tags are working and make them native
Diffstat (limited to 'src/loaders/pleroma.ts')
-rw-r--r--src/loaders/pleroma.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/loaders/pleroma.ts b/src/loaders/pleroma.ts
index 975f57e..c57a22b 100644
--- a/src/loaders/pleroma.ts
+++ b/src/loaders/pleroma.ts
@@ -552,14 +552,14 @@ function replaceHashtagsWithLinks(content: string): {
// First, replace existing markdown hashtag links: [#tag](any-url)
let modifiedContent = content.replace(/\[#(\w+)\]\([^)]+\)/g, (_match, tag) => {
tags.push(tag.toLowerCase());
- return `[#${tag}](/micro/tags/${tag.toLowerCase()})`;
+ return `[#${tag}](/tags/${tag.toLowerCase()})`;
});
// Then, replace plain #hashtags (not already in markdown link format)
// Negative lookbehind to avoid matching hashtags already in [#tag] format
modifiedContent = modifiedContent.replace(/(?<!\[)#(\w+)(?!\])/g, (_match, tag) => {
tags.push(tag.toLowerCase());
- return `[#${tag}](/micro/tags/${tag.toLowerCase()})`;
+ return `[#${tag}](/tags/${tag.toLowerCase()})`;
});
return {
@@ -699,7 +699,7 @@ export function pleromaLoader(config: PleromaFeedConfig): Loader {
const { content: contentWithTags, tags: extractedTags } = replaceHashtagsWithLinks(
merged.content,
);
- tags = extractedTags;
+ tags = [...extractedTags, "micro"];
cleanedContent = replacePleromaLinks(contentWithTags, instanceUrl, allPostIds);
attachments = merged.attachments;
postId = status.id;
@@ -709,7 +709,7 @@ export function pleromaLoader(config: PleromaFeedConfig): Loader {
const rawContent = cleanContent(content);
const { content: contentWithTags, tags: extractedTags } =
replaceHashtagsWithLinks(rawContent);
- tags = extractedTags;
+ tags = [...extractedTags, "micro"];
cleanedContent = replacePleromaLinks(contentWithTags, instanceUrl, allPostIds);
postId = status.id;
sourceUrl = status.url;