Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edge case with rehype-urls and trailing slashes in image file paths #849

Merged
merged 2 commits into from Dec 7, 2023

Conversation

shiyouganai
Copy link
Contributor

Yet another #832 add-on. 馃珷

Because of the way Github Pages serves images, it looks like they don't ignore trailing slashes i.e. https://site.com/image.png is served but https://site.com/image.png/ is not. Unfortunately this is different than the localhost server behavior where the slash is ignored so I didn't see this behavior until it went "live."

Thus, the rehype plugin needs to check if the url's resource path has a file extension and make sure not to add a trailing slash if it does. I do this rather primitively by checking if there is a '.' anywhere in the url pathname. Seems to work fine. I also added back in the serialized parameter subsection of urls just in case that's needed in the future.

@felixroos felixroos merged commit 5cac182 into tidalcycles:main Dec 7, 2023
1 check passed
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.

None yet

2 participants