Jacky Zhao
2023-11-16 f861a7c160a0b3be76a16c5bf2ea1a8d076a9662
fix: regression where clicking anchors on the same page wouldn't set the anchor in the url
1 files modified
3 ■■■■ changed files
quartz/components/scripts/spa.inline.ts 3 ●●●● patch | view | raw | blame | history
quartz/components/scripts/spa.inline.ts
@@ -15,7 +15,7 @@
    if (window.location.origin === url.origin) {
      return true
    }
  } catch (e) {}
  } catch (e) { }
  return false
}
@@ -109,6 +109,7 @@
      if (isSamePage(url) && url.hash) {
        const el = document.getElementById(decodeURIComponent(url.hash.substring(1)))
        el?.scrollIntoView()
        history.pushState({}, "", url)
        return
      }