fix for '_' in hash and with '?'
This commit is contained in:
@@ -332,8 +332,12 @@ const Docs = (defaultprops) => {
|
|||||||
|
|
||||||
|
|
||||||
const scrollToHash = () => {
|
const scrollToHash = () => {
|
||||||
const hash = window.location.hash.replace("#", "")
|
var hash = window.location.hash.replace("#", "").replaceAll("_", "-");
|
||||||
|
if (hash.includes('?')) {
|
||||||
|
hash = hash.split('?')[0]
|
||||||
|
}
|
||||||
if (hash) {
|
if (hash) {
|
||||||
|
console.log("HASH: ", hash)
|
||||||
const element = document.getElementById(hash)
|
const element = document.getElementById(hash)
|
||||||
if (element) {
|
if (element) {
|
||||||
element.scrollIntoView({
|
element.scrollIntoView({
|
||||||
|
|||||||
Reference in New Issue
Block a user