-
-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Description
Hello there.
Got this error when trying to scroll to an anchor with an ID starting with a digit :
vue-scrollto.js?f13c:180 Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '#3-scripts' is not a valid selector.
Notes : IDs are generated with rehype slug, using github-slugger
ID with a digit first are valid spec int HTML, but not a valid CSS Selector. Could be possible to failsafe that without changing slug generation policy though.
Some insights :
https://stackoverflow.com/questions/20306204/using-queryselector-with-ids-that-are-numbers
https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape
document.querySelector("[id='1']")
Metadata
Metadata
Assignees
Labels
No labels