I’m trying to create a url in a javascript section in a template on my site
let obj = {something: "{{ .Site.BaseURL }}img/icon.jpg"}
However in the rendered HTML the forward slashes get quoted with backslashes
http:\/\/example.com\/img/icon.jpg"
I have tried safeJS and jsonfiy (as mentioned in Solved: Url forward slashes rendered quoted with backslash) but they don’t seem to help. Why is this happening and how can I fix it?