refactor: 🔥 Remove old Note code

This commit is contained in:
Jesse Wierzbinski 2024-12-01 17:26:51 +01:00
parent c6f8ba081d
commit 0b6acd98dd
No known key found for this signature in database
13 changed files with 6 additions and 785 deletions

View file

@ -1,7 +1,5 @@
import type { Account, Emoji } from "@versia/client/types";
import { renderToString } from "vue/server-renderer";
import { SettingIds, type Settings } from "~/settings";
import MentionComponent from "../components/social-elements/notes/mention.vue";
const emojisRegex =
/\p{RI}\p{RI}|\p{Emoji}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u200D(\p{RI}\p{RI}|\p{Emoji}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?))*/gu;
@ -70,25 +68,6 @@ export const useParsedContent = (
);
}
// Replace links containing mentions with interactive mentions
const links = contentHtml.querySelectorAll("a");
for (const link of links) {
const mention = toValue(mentions).find(
(m) => link.textContent === `@${m.acct}`,
);
if (!mention) {
continue;
}
const renderedMention = h(MentionComponent);
renderedMention.props = {
account: mention,
};
link.outerHTML = await renderToString(renderedMention);
}
result.value = contentHtml.innerHTML;
},
{ immediate: true },