Fix "try in playground" URLs broken when b64 contains + #24
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.
The "Try it in the playground" links in code blocks are broken when the base64 encoding of the code contains the character
+
, as it is a reserved character in URLs which gets replaced by a space on the playground's end, which completely breaks the code.Example: the first code block of this section https://docs.vlang.io/functions-2.html#lambda-expressions
Should be
But in the playground it opens like so:
Some blocks are even more broken, such as this one https://docs.vlang.io/concurrency.html#channel-select which makes the playground fail to display anything.
The fix is simple, correctly encode the query param value.