Skip to content

Conversation

hchargois
Copy link

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

mut a := [1, 2, 3]
a.sort(|x, y| x > y) // sorts the array, defining the comparator with a lambda expression
println(a.map(|x| x * 10)) // prints [30, 20, 10]

But in the playground it opens like so:

image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant