-
Notifications
You must be signed in to change notification settings - Fork 1.7k
anchors with spaces #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, the code responsible for this is here. I guess the best action is to convert spaces to underscores and check if the url already contains a hashtag. |
The only issue would be, I would think, that if spaces now become underscores, any previous urls with So after the fix of spaces to underscores, it won't work anymore; only this would then work: I'm not sure how much this backward-compatibility should matter on deciding whether or not to implement the spaces to underscores. Just putting it out there. |
You're right, I have always announced mdBook as "unstable" to allow for changes like these. But I can understand that this could be a pain. I don't feel strongly about one ( |
Cool. I guess I could make a PR with Thanks for pointing me to the code above. I'll see if I can figure out how to do this with my limited know-how :D Cheers! EDIT: EDIT2: worth knowing: https://stackoverflow.com/questions/16573774/in-page-anchors-with-spaces-in-the-title/16573847#16573847 EDIT3: cool! it works as I want it to! PR shortly. |
Fixes #156 - anchors are now URI encoded
Hello. Clicking on anchors generate urls with spaces which seem unusable when trying to link to, for example here:
https://rust-lang.github.io/book/ch04-02-ownership.html#Variable binding scope
Is there a way to make the spaces be %20 or whatever is idiomatic in these cases?
Thanks.
The text was updated successfully, but these errors were encountered: