waldyrious / primerpedia

Simplified extracts of Wikipedia articles, showing just the basic information.
https://primerpedia.toolforge.org
Other
11 stars 7 forks source link

Use + or _ instead of %20 in URL, for ease of sharing #40

Closed waldyrious closed 6 years ago

waldyrious commented 6 years ago

(See #34 and #22 for context.)

Currently the URL is updated to reflect the article being shown, and this includes raw spaces. For example:

http://waldyrious.github.io/primerpedia/?search=Avatar%20(2009%20film)

It would be easier to read and share such URLs if the spaces were instead replaced by +, as is customary for form-submitted inputs, or _, which is what Wikipedia uses for article titles. So in the case above, that would be:

http://waldyrious.net/primerpedia/?search=Avatar_(2009_film)

Both URLs should work and show the title in the HTML with spaces, and in the URL with either _ or +, for both searches performed manually, and articles loaded using the random feature.

waldyrious commented 6 years ago

Fixed by @Nalapl3 in #41. Thanks! :+1: