From 5c01944cfb661bfd8c70c9276f1eda5b5b353f63 Mon Sep 17 00:00:00 2001 From: Jamie <31554168+flaree@users.noreply.github.com> Date: Sun, 22 Aug 2021 03:39:30 -0700 Subject: [PATCH] Handle subdomains on URLs --- src/components/markdown/Renderer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/markdown/Renderer.tsx b/src/components/markdown/Renderer.tsx index fe73b11a..c33f4a09 100644 --- a/src/components/markdown/Renderer.tsx +++ b/src/components/markdown/Renderer.tsx @@ -172,7 +172,7 @@ export default function Renderer({ content, disallowBigEmoji }: MarkdownProps) { try { const url = new URL(href, location.href); - if (url.hostname === location.hostname) { + if (url.hostname.replace(/^[^.]+\./g, "") === location.hostname.replace(/^[^.]+\./g, "")) { internal = true; element.addEventListener( "click",