# Unpredictable URL encoding

**URL:** <https://discourse.gohugo.io/t/unpredictable-url-encoding/11904>\
**Category:** support\
**Created:** [May 9, 2018, 12:19pm UTC](https://discourse.gohugo.io/t/unpredictable-url-encoding/11904 "2018-05-09T12:19:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsteenb2](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jsteenb2](https://discourse.gohugo.io/u/jsteenb2)\
**Post date:** [May 9, 2018, 12:19pm UTC](https://discourse.gohugo.io/t/unpredictable-url-encoding/11904/1 "2018-05-09T12:19:30Z")

</div>

I am working with the following:

\<img src=’{{ “{{ image }}” }}’ alt=’{{ “{{ name }}” }}’ … other stuff /\>

The html produced for alt is `alt={{name}}`, which is desired. However, the src gets url encoded (undesired), `src='products/%7b%7b%20image%20%7d%7d'`.

Is there a way to eliminate the url encoding on the src?

---

<div class="post-metadata">

**Author:** ![kaushalmodi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/kaushalmodi/32/2567_2.png) [@kaushalmodi](https://discourse.gohugo.io/u/kaushalmodi)\
**Post date:** [May 9, 2018, 12:32pm UTC](https://discourse.gohugo.io/t/unpredictable-url-encoding/11904/2 "2018-05-09T12:32:12Z")

</div>

> [@jsteenb2](#):
>
> \<img src=’{{ “{{ image }}” }}’ alt=’{{ “{{ name }}” }}’ … other stuff /\>

You cannot nest the curly braces. Instead use `printf` + `safeHTML` I.e. do something like:

```auto
{{ printf `<img src="%s" alt="%s" … other stuff />` $var_holding_src $var_holding_alt | safeHTML }}

```
