diff --git a/plugins/EmojiRenderer.ts b/plugins/EmojiRenderer.ts index 83a8ace..7a77154 100644 --- a/plugins/EmojiRenderer.ts +++ b/plugins/EmojiRenderer.ts @@ -44,6 +44,14 @@ export default defineNuxtPlugin((nuxtApp) => { return `${match}`; }); } + + // Make all links that don't open to the same origin open in a new tab + for (const link of el.querySelectorAll("a")) { + if (link.hostname !== location.hostname) { + link.target = "_blank"; + link.rel = "noopener noreferrer"; + } + } }, }); });