p0: legacy hash fallback without rewriting URL
Some checks failed
CI / build-and-anchors (push) Failing after 35s
Some checks failed
CI / build-and-anchors (push) Failing after 35s
This commit is contained in:
@@ -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" });
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user