From 8ec6c0c0741c392cae55a58e5975da88b1e2939c Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Wed, 15 May 2024 06:15:06 +0000 Subject: [PATCH] fix for '_' in hash and with '?' --- frontend/src/views/Docs.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx index 61b83fac..39c40cd0 100755 --- a/frontend/src/views/Docs.jsx +++ b/frontend/src/views/Docs.jsx @@ -332,8 +332,12 @@ const Docs = (defaultprops) => { const scrollToHash = () => { - const hash = window.location.hash.replace("#", "") + var hash = window.location.hash.replace("#", "").replaceAll("_", "-"); + if (hash.includes('?')) { + hash = hash.split('?')[0] + } if (hash) { + console.log("HASH: ", hash) const element = document.getElementById(hash) if (element) { element.scrollIntoView({