fix for '_' in hash and with '?'
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user