summaryrefslogtreecommitdiff
path: root/src/loaders/pleroma.ts
diff options
context:
space:
mode:
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;