accept suggestion

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
pull/869/head
Georges Gomes 3 years ago committed by GitHub
parent 2720a36b27
commit 3b45435007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,13 +43,9 @@ export function createRouter(
// ensure correct deep link so page refresh lands on correct files.
const url = new URL(href, fakeHost)
// ensure correct deep link so page refresh lands on correct files.
if (siteDataRef.value.cleanUrls) {
// Should we replace `/foo.html` -> `/foo` ? :thinking:
} else {
if (!url.pathname.endsWith('/') && !url.pathname.endsWith('.html')) {
url.pathname += '.html'
href = url.pathname + url.search + url.hash
}
if (!url.pathname.endsWith('/') && !url.pathname.endsWith('.html')) {
url.pathname += siteDataRef.value.cleanUrls ? '/' : '.html'
href = url.pathname + url.search + url.hash
}
if (inBrowser) {
// save scroll position before changing url

Loading…
Cancel
Save