Handle subdomains on URLs

This commit is contained in:
Jamie 2021-08-22 03:39:30 -07:00 committed by GitHub
parent db43c02e01
commit 5c01944cfb
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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",