Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@skrosoft
Copy link

@skrosoft skrosoft commented Sep 12, 2024

Markdown titles that contains accents (example: in Spanish) has an encoded location.hash.

To make the scrollDown working in that cases, you need to use decodeURIComponent, in the other case the element will not be found and scrollDown will not occur.

An example with the title "Configuración" ("Configuration" in Spanish)

Configuración

location.hash:
"#2-configuraci%C3%B3n"
# the letter "ó" is encoded

But the element ID has the accent without the encoding:

Captura de pantalla 2024-09-12 a la(s) 10 12 03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant