diff --git a/src/plugins/fakeNitro/index.tsx b/src/plugins/fakeNitro/index.tsx index 3c5ffd751..3eeabab14 100644 --- a/src/plugins/fakeNitro/index.tsx +++ b/src/plugins/fakeNitro/index.tsx @@ -338,8 +338,8 @@ export default definePlugin({ { // Call our function to decide whether the emoji link should be kept or not predicate: () => settings.store.transformEmojis, - match: /1!==(\i)\.length\|\|1!==\i\.length/, - replace: (m, content) => `${m}||$self.shouldKeepEmojiLink(${content}[0])` + match: /(\i)=\(0,\i\.\i\)\((\i)\)(?=&&)(?<=\i=\1,\2=\(\i\?\?\i\)\.embeds.{0,50}?)/, + replace: (m, content, _embeds) => `${m} && !$self.shouldKeepEmojiLink(${content}[0])` }, { // Patch the rendered message content to add fake nitro emojis or remove sticker links diff --git a/src/plugins/imageLink/index.ts b/src/plugins/imageLink/index.ts index 0d01cb1d3..c3edeb23a 100644 --- a/src/plugins/imageLink/index.ts +++ b/src/plugins/imageLink/index.ts @@ -15,7 +15,8 @@ export default definePlugin({ patches: [ { - find: "unknownUserMentionPlaceholder:", + // small util file + find: "={linkCount:0,onlyLinks:!1};function ", replacement: { // SimpleEmbedTypes.has(embed.type) && isEmbedInline(embed) match: /\i\.has\(\i\.type\)&&\(0,\i\.\i\)\(\i\)/,