From 6461f5d42b3bfed1d7959e1167fc77f61d08f314 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 9 Jun 2024 20:09:36 +0530 Subject: [PATCH] fix(client): do nothing on anchor elements with empty href closes #3950 --- src/client/app/router.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 035c416a..5e67a57b 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -187,10 +187,10 @@ export function createRouter( (link instanceof SVGElement || !link.download) ) { const { target } = link + const linkHref = link.getAttribute('href') + if (linkHref == null) return const { href, origin, pathname, hash, search } = new URL( - link.href instanceof SVGAnimatedString - ? link.href.animVal - : link.href, + linkHref, link.baseURI ) const currentUrl = new URL(location.href) // copy to keep old data