-
Notifications
You must be signed in to change notification settings - Fork 722
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
WebHost: Fix setup guide link not working for games with special characters #3269
Conversation
Not actually sure whether this is the best way to do this, but it does work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Tested and it works as expected now. In my opinion this is the correct approach - if we're generating the IDs in tutorialLanding.js by url-encoding it, it makes sense to also do so when generating links to it.
I think |
To use
|
Confirmed that this is correct, in which case I would rather keep this PR as is, rather than doing it like in this code snippet. |
|
Huh. For some reason I didn't think you could use filters inside an argument list. TIL. Yeah, that works. Do that. |
Sure, I guess I didn't care to mess with the structure of the code but I can do that if you think it's better |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, imo moving the anchor to url_for is a lot better than mixing "plain text" in.
I have not tested the final version here, but I suspect you did.
…acters (ArchipelagoMW#3269) * WebHost: Fix setup guide link not working for games with special characters * use url_for with _anchor (ArchipelagoMW#3279)
…acters (ArchipelagoMW#3269) * WebHost: Fix setup guide link not working for games with special characters * use url_for with _anchor (ArchipelagoMW#3279)
"Mario & Luigi - Superstar Saga" contains the character
&
.The DOM element for it on the "Archipelago Guides" page has the id
Mario%20%26%20Luigi%20Superstar%20Saga
. This is because tutorialLanding.js line 26 usesencodeURIComponent(game.gameTitle)
, which escapes special uri characters.However, the link on the supported games page goes to
/tutorial/#Mario%20&%20Luigi%20Superstar%20Saga
.This is because
supportedGames.html
just directly uses#{{ game_name }}
.This causes the autoscroll down to the correct setup guide not to work when clicking on this link.
Using
#{{ game_name|urlencode }}
makes it work as expected.