Refactor (5)

This commit is contained in:
2026-02-24 22:21:29 +09:00
parent c986bb861a
commit 9356ae18bc
2 changed files with 17 additions and 5 deletions

View File

@@ -72,3 +72,9 @@ export async function expandReplyTree(
}
return { last: current, history: history.reverse() };
}
export const sanitizeText = (text: string) =>
text
.replaceAll(/(\r\n|\r|\n)\s+/g, "\n\n") // remove extra newlines
.replaceAll("@", "") // remove mentions
.replaceAll("#", ""); // remove hashtags