& becomes & in string

When I try to execute
wixLocation . to ( “mailto:example@email.com?subject=Helloworld&body=Helloworld!” )
It the string actually becomes
“mailto:example@email.com?subject=Helloworld&body=Helloworld!”

Or, this is the same when I have a button and assigns a string to the link, e.g.,
$w(‘#button’).link = “mailto:example@email.com?subject=subject&content=content”
would end up becoming “mailto:example@email.com?subject=subject&content=content”

Or, in other words, wix automatically escapes the character & when used in links. Is there a way to prevent this from happening as how obvious it’s stupid.
Thanks

What browser?

Chrome.

@lac13641361467 I tried it and couldn’t reproduce the issue

@jonatandor35 See, for instance, in line 48 of the code, I have

wixLocation . to ( “mailto:example@email.com?subject=Helloworld&body=Helloworld!” )

but when I publish the website, the console tells me that it is actually redirecting to

mailto:example@email.com?subject=Helloworld&body=Helloworld!”

Thanks!

@lac13641361467 and what happens when you click the link?

@jonatandor35 The “Helloworld!” string does not appear in the body of the email. Only “Helloworld” appears in the subject.

@lac13641361467
It looks like a bug with URI encoding with Velo.
I can suggest 2 alternatives:

  1. Instead a button, use text and html with href. Something like:
$w("#text1").html = `<a href="mailto:example@email.com?subject=${encodeURI('Hello')}&body=${encodeURI('Dear Friend'}">SEND</a>`; 
  1. Create a button in an iframe (embedded widget) or a custom element and use code like:
<body>
  <script>
    function  openWin(){
      window.open(`mailto:example@email.com?subject=${encodeURI('Hello')}&body=${encodeURI('Dear Friend'}`);
    }
  </script>
  <button onclick="openWin()">
    SEND
    </button>
</body>

And post messages from page to iframe and vice versa if needed.

And another option is to use a 3rd party URL shortening service to get an https URL that redirects to mailto.
If it’s dynamic, you’ll have to install an NPM or call an API to create it.