# HTML Code within Variables

**URL:** https://discourse.gohugo.io/t/html-code-within-variables/4198
**Category:** support
**Created:** [September 28, 2016, 8:34pm UTC](https://discourse.gohugo.io/t/html-code-within-variables/4198 "2016-09-28T20:34:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Clms](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@Clms](https://discourse.gohugo.io/u/Clms)
#### Post date: [September 28, 2016, 8:34pm UTC](https://discourse.gohugo.io/t/html-code-within-variables/4198/1 "2016-09-28T20:34:56Z")

</div>

Hi!  
I was looking for a way to place HTML within a variable.

E.g.:  
`title = "Thisisaverylongword &amp; whichneedstobreaksomewhere".`

Right now Hugo is rendering `"&amp;"` instead of the &-sign.

Is there a workaround?

Thanks a lot!

---

<div class="post-metadata">

### Author: ![digitalcraftsman](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/digitalcraftsman/32/4142_2.png) [@digitalcraftsman](https://discourse.gohugo.io/u/digitalcraftsman)
#### Post date: [September 28, 2016, 8:39pm UTC](https://discourse.gohugo.io/t/html-code-within-variables/4198/2 "2016-09-28T20:39:13Z")

</div>

Inside the template you could pipe your variable to the `html` template function. E.g.

```
{{ .Params.title | html }}
```

---

<div class="post-metadata">

### Author: ![Jura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jura/32/13581_2.png) [@Jura](https://discourse.gohugo.io/u/Jura)
#### Post date: [October 1, 2016, 4:02pm UTC](https://discourse.gohugo.io/t/html-code-within-variables/4198/3 "2016-10-01T16:02:41Z")

</div>

> [@digitalcraftsman](#):
>
> Inside the template you could pipe your variable to the html template function.

Out of curiosity, is there a difference between `html` and [`safeHTML`](http://gohugo.io/templates/functions/#safehtml)?

---

<div class="post-metadata">

### Author: ![Clms](https://avatars.discourse-cdn.com/v4/letter/c/54ee81/32.png) [@Clms](https://discourse.gohugo.io/u/Clms)
#### Post date: [October 2, 2016, 9:23am UTC](https://discourse.gohugo.io/t/html-code-within-variables/4198/4 "2016-10-02T09:23:45Z")

</div>

Thanks a lot! 🙂
