From 3d678d38bcb4a72cb7fc4502e2790c368937149e Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sat, 13 Sep 2025 15:53:13 +0530 Subject: [PATCH] tweak --- 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 83ad18f3..0f1ca8e5 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -54,7 +54,7 @@ export interface Router { export const RouterSymbol: InjectionKey = Symbol() // we are just using URL to parse the pathname and hash - the base doesn't -// matter and is only passed to support same-host hrefs. +// matter and is only passed to support same-host hrefs const fakeHost = 'http://a.com' const getDefaultRoute = (): Route => ({ @@ -278,7 +278,7 @@ export function scrollTo(hash: string, smooth = false, scrollPosition = 0) { targetPadding const scrollToTarget = () => { - // only smooth scroll if distance is smaller than screen height. + // only smooth scroll if distance is smaller than screen height if (!smooth || Math.abs(targetTop - window.scrollY) > window.innerHeight) window.scrollTo(0, targetTop) else window.scrollTo({ left: 0, top: targetTop, behavior: 'smooth' }) @@ -325,7 +325,7 @@ function shouldHotReload(payload: PageDataPayload): boolean { function normalizeHref(href: string): string { const url = new URL(href, fakeHost) url.pathname = url.pathname.replace(/(^|\/)index(\.html)?$/, '$1') - // ensure correct deep link so page refresh lands on correct files. + // ensure correct deep link so page refresh lands on correct files if (siteDataRef.value.cleanUrls) { url.pathname = url.pathname.replace(/\.html$/, '') } else if (!url.pathname.endsWith('/') && !url.pathname.endsWith('.html')) {