diff options
| author | Anhgelus Morhtuuzh <anhgelus@anhgelus.world> | 2024-12-10 22:21:32 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus@anhgelus.world> | 2024-12-10 22:21:32 +0100 |
| commit | fb39dc533c6df0871059bafdfe96bc8eb933d7a4 (patch) | |
| tree | a524c68f5e218e2e03ba3c80994af5b56eff32ae /index.ts | |
| parent | f06323ab2bb56f5a813f2dd88eed1c2a7cf31050 (diff) | |
feat(tag): better behavior for tag with internal link
Diffstat (limited to 'index.ts')
| -rw-r--r-- | index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3,7 +3,8 @@ function setupEvents() { t.addEventListener("click", _ => { const link = t.getAttribute("data-href") if (link === null || link === "") return - window.open(link) + if (!link.startsWith(window.location.origin) && link.startsWith("https://")) window.open(link) + else changePage(link) }) }) |
