Handle subdomains on URLs

This commit is contained in:
Jamie
2021-08-22 03:39:30 -07:00
committed by GitHub
parent af99c7e1fd
commit 7d937af8fc

View File

@@ -172,7 +172,7 @@ export default function Renderer({ content, disallowBigEmoji }: MarkdownProps) {
try { try {
const url = new URL(href, location.href); const url = new URL(href, location.href);
if (url.hostname === location.hostname) { if (url.hostname.replace(/^[^.]+\./g, "") === location.hostname.replace(/^[^.]+\./g, "")) {
internal = true; internal = true;
element.addEventListener( element.addEventListener(
"click", "click",