From 52411f6cb9efc10dd683096b34e5c279a11f7e0a Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 13 Jan 2026 15:31:19 +0100 Subject: Rework how tags are working and make them native --- src/loaders/pleroma.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/loaders/pleroma.ts') 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(/(? { 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; -- cgit v1.2.3