Reports link breaks when put into a post as a link with text

This is a bit of a weird little one, but highlights a problem with links in posts which are associated with text.

If I:

  1. create a data explorer query with a variable
  2. and assign it to a group
  3. visit the URL via the group’s reports tab
  4. add the variable and run the query
  5. copy the URL and add it to some text in a post

then the URL is corrupted / broken.

What I observe is:

  1. This is an example link thus created (private sorry):
    https://ehealthforum.nz/g/HiNZ-staff/reports/128?params=%7B%22topic_id%22%3A%2234521%22%7D
  2. When I add this link to some text here something goes screwy with the URL encoding and we get this:
    https://ehealthforum.nz/g/HiNZ-staff/reports/128?params=%257B%2522topic_id%2522%253A%252234521%2522%257D

And that beautifully breaks the site!

If I simply paste the link in the post, this doesn’t happen - it is only when I add it to text. So something goes funny when it encounters some existing encoding I think.