This commit is contained in:
2026-09-15 22:57:34 +09:00
parent afa8f1fcb6
commit a9586d7dab
13 changed files with 897 additions and 123 deletions
+2 -7
View File
@@ -59,6 +59,7 @@ export async function expandReplyTree(
note: Note,
cutoff = 5,
): Promise<{ last: Note; history: Note[] }> {
const last = note;
let current = note;
let count = 0;
const history: Note[] = [];
@@ -70,11 +71,5 @@ export async function expandReplyTree(
current = parent;
count++;
}
return { last: current, history: history.reverse() };
return { last, 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