Skip to content

Commit

Permalink
Fix smooth scroll (#164)
Browse files Browse the repository at this point in the history
The function addSmoothScroll causes an error if a target link contains multibyte characters.
Decoding `this.hash` can prevent.
  • Loading branch information
noritakaIzumi authored Nov 13, 2020
1 parent 38fdbbf commit 6c03dd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var isMobile = false, isTablet = false, isLaptop = false;
location.hostname == this.hostname
) {
// Figure out element to scroll to
var target = $(this.hash);
var target = $(decodeURI(this.hash));
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
// Does a scroll target exist?
if (target.length) {
Expand Down

0 comments on commit 6c03dd7

Please sign in to comment.