Skip to content

Commit

Permalink
global id regex
Browse files Browse the repository at this point in the history
  • Loading branch information
recrwplay committed Oct 11, 2023
1 parent 8bb1ad3 commit d4b741d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/50-cheat-sheet-toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ document.addEventListener('DOMContentLoaded', function () {
document.location.hash = scrollToSection
}
document.location.replace(document.location.href.replace(document.location.search, ''))
console.log(document.location)
}

// check for a checkbox to display or hide labels
Expand Down Expand Up @@ -438,9 +437,10 @@ function fixURL () {
}

function checkHashVariations (id) {
const dashes = /-/g
const idVariants = [
id,
'_' + id.replace('-', '_'),
'_' + id.replace(dashes, '_'),
]

const actualID = idVariants.filter(function (i) {
Expand Down

0 comments on commit d4b741d

Please sign in to comment.