Use hyphens in URLs for accessibility and readability #2150
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
I strongly recommend using hyphens in URLs rather than spaces:
They make things harder for people using screen readers:
Attached is the Android screen reader reading out each of these two URLs when selecting the address bar in Chrome.
screen-reader-urls.zip
For the one with hyphens, it reads out the words and doesn't say "hyphen".
For the one with spaces, it says "python percent 200 2 percent 20 sunset".
From #2134 (comment):
It doesn't actually appear nicer in my browser (Chrome 81, macOS Mojave and similar in Chrome on Android):
Nor Opera 68:
Firefox 76 is okay and shows the spaces:
Irrelevant for Safari, which only shows the domain:
This not only affects how the URL looks and sounds in the address bar, but also when pasted elsewhere, for example:
It can also cause difficulty for some when copying and pasting, and RFC 1738 on URLs declares spaces unsafe:
Pull Request Checklist