rafgraph / spa-github-pages

Host single page apps with GitHub Pages
https://spa-github-pages.rafgraph.dev
MIT License
3.83k stars 565 forks source link

['] being converted to [%27] and breaking React Router #56

Closed Aarnavv closed 2 years ago

Aarnavv commented 2 years ago

Hey! Thanks a lot for the code. It seems to be working fine for the most parts but when the URL has " ' " in it, for example,

/editions/august'21-edition

it is being converted to

/editions/august%2721-edition

which is breaking the link.

Since I am using React Router,

      <Route path="/editions/august'21-edition" element={<><Publication edition={2} /></>} />

it is breaking the website.

You can view this issue yourself at https://the-innominate-newsletter.github.io/ You can try to click on any one of the cards and then try to refresh the page and you will see what I am talking about.

Thank you for taking the time to read this and helping me out!

rafgraph commented 2 years ago

Hi, apostrophes ' aren't valid characters to use in a url. The browser is automatically encoding the ' to %27 when it's part of the query string.