p0: legacy hash fallback without rewriting URL
Some checks failed
CI / build-and-anchors (push) Failing after 35s

This commit is contained in:
2026-01-20 16:39:45 +01:00
parent 874c630a2a
commit a09dbca800

View File

@@ -92,7 +92,8 @@ const GITEA_REPO = import.meta.env.PUBLIC_GITEA_REPO ?? "";
const replacement = document.querySelector(`[id^="${prefix}"]`); const replacement = document.querySelector(`[id^="${prefix}"]`);
if (!replacement) return; if (!replacement) return;
history.replaceState(null, "", `${window.location.pathname}#${replacement.id}`); console.warn("[anchors] legacy hash fallback used:", `#${oldId}`, "→", `#${replacement.id}`);
// On ne réécrit PAS le hash : on garde la citabilité historique visible.
replacement.scrollIntoView({ block: "start" }); replacement.scrollIntoView({ block: "start" });
})(); })();