Delete spaces from a string that will be used to create a URL via Markdown

I have a webform that, after submission, might need to be filled out with some of the same information and submitted again. After the first submission, an email gets sent to the user with a clickable link back to the form, to pre-populate it with the same choices, using the auto-populate URL feature:
The email uses Markdown to show the link:
However, if any of your fields (i.e. what the user entered) have spaces in them, the hyperlink won't appear correctly in the email. The link will "drop off" after the appearance of the first space, and both the text in [brackets] and the link in ( ) will appear in the email.
To fix this, first use a Field: Set value of a text field task to first concatenate and build the URL string (I call it {{url}}) with your field values.
Then use a Field Formulas task with the following javascript to edit the string by replacing the spaces with %20