From ea852a61dccfef6f626551e5f863869de8d736ba Mon Sep 17 00:00:00 2001 From: Daiki Urata <7nohe.urata@gmail.com> Date: Mon, 2 Sep 2024 21:20:27 +0900 Subject: [PATCH 1/2] fix: update querySelector to use encodeURIComponent for link hash --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index f2e50f8..2d5390e 100644 --- a/js/main.js +++ b/js/main.js @@ -152,7 +152,7 @@ export function initBaseComponents(Alpine) { .slice() .reverse() .find((link) => { - const el = document.querySelector(link.hash) + const el = document.querySelector(encodeURIComponent(link.hash)) return el.getBoundingClientRect().top <= 100 }) ?? links[0] From 379821ac016242abb62e1f5f2e0d8bc62e70ad24 Mon Sep 17 00:00:00 2001 From: Daiki Urata <7nohe.urata@gmail.com> Date: Mon, 2 Sep 2024 21:47:54 +0900 Subject: [PATCH 2/2] fix: update querySelector to use decodeURIComponent for link hash --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 2d5390e..0e32725 100644 --- a/js/main.js +++ b/js/main.js @@ -152,7 +152,7 @@ export function initBaseComponents(Alpine) { .slice() .reverse() .find((link) => { - const el = document.querySelector(encodeURIComponent(link.hash)) + const el = document.querySelector(decodeURIComponent(link.hash)) return el.getBoundingClientRect().top <= 100 }) ?? links[0]