mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
refactor: 🔥 Remove old Note code
This commit is contained in:
parent
c6f8ba081d
commit
0b6acd98dd
13 changed files with 6 additions and 785 deletions
|
|
@ -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 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue