-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat: Prettify URLs #372
feat: Prettify URLs #372
Conversation
Don't URL-encode safe characters, and fix the array parser logic. Closes #355.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
When do we think this could go live? I am doing a project with this and literary want to replace it with a diff library due to encoding/ugly URLs lol |
Can you give 1.9.0-beta.1 a try and see if the encoding works out for you? |
Will do, later today or tomorrow morning. |
@franky47 I tried it and everything works, will use it to finish the project. |
@sladjanstojcic Thanks for your feedback, 1.9.0 should be landing soon. |
🎉 This PR is included in version 1.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Don't URL-encode safe characters, and fix the array parser logic.
Proposed encoding, compared with built-in solutions:
Explanation:
+
is encoded as%2B
in order not to be confused with a space according to RFC-3986. Equally, spaces will be changed to+
(not shown here)%
are encoded to avoid being interpreted as incomplete escape sequences#
is encoded to avoid being interpreted as the URL hash and breaking the query string&
is encoded to avoid being interpreted as a query entry separator"
,'
and backtick are encoded to avoid breaking URLs when pasted as-is in editors that detect them and emit an anchor tag (social networks, messaging apps).Compared to
encodeURI
, the following characters are un-encoded:[\]^{|}
. Brackets are particularly useful to keep "pretty" in order to identify arrays or objects when using the JSON parser.Closes #355.