# Shortcode + html

**URL:** https://discourse.gohugo.io/t/shortcode-html/21917
**Category:** support
**Created:** [November 22, 2019, 2:32pm UTC](https://discourse.gohugo.io/t/shortcode-html/21917 "2019-11-22T14:32:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![hucste](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hucste/32/10014_2.png) [@hucste](https://discourse.gohugo.io/u/hucste)
#### Post date: [November 22, 2019, 2:32pm UTC](https://discourse.gohugo.io/t/shortcode-html/21917/1 "2019-11-22T14:32:29Z")

</div>

Hi, all.

I created on shortcode to manage blockquote html as:

```auto
<div class="info-quote"><p class="text-white-50">{{ i18n "quoteTitle" }}</p></div><div class="quote"><blockquote>{{ $file := .Get 0 | readFile }}{{ $file }}</blockquote></div>

```

Into file.md, I call as:

```auto
{{% blockquote "/content/inc/file-to-include" %}}

```

In this file, it wrote:

```auto
<span class="red">It appears you do not have permission to view information… </span>

blablablabla... and re-blablabla.

```

but, the result escape the html code !

How I can modify my shortcode to view correct embed html code?  
I test with function `htmlUnescape`, but without success. ☹

* * *

PS : I run hugo v0.53 under OpenBSD 6.6!

---

<div class="post-metadata">

### Author: ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)
#### Post date: [November 22, 2019, 2:43pm UTC](https://discourse.gohugo.io/t/shortcode-html/21917/2 "2019-11-22T14:43:09Z")

</div>

Since your shortcode does not contain markdown instead of using `%` use the `< >` delimiters.

Also see: [https://gohugo.io/content-management/shortcodes/#shortcodes-without-markdown](https://gohugo.io/content-management/shortcodes/#shortcodes-without-markdown)

---

<div class="post-metadata">

### Author: ![hucste](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hucste/32/10014_2.png) [@hucste](https://discourse.gohugo.io/u/hucste)
#### Post date: [November 22, 2019, 3:06pm UTC](https://discourse.gohugo.io/t/shortcode-html/21917/3 "2019-11-22T15:06:54Z")

</div>

OK, thanks!

If I write:

```auto
{{< blockquote >}}
<span class="red">It appears you do not have permission to view information… </span>

blablablabla... and re-blablabla.
{{< /blockquote >}}

```

And, convert the shortcode as:

```auto
<div class="info-quote"><p class="text-white-50">{{ i18n "quoteTitle" }}</p></div><div class="quote"><blockquote>{{ .Inner }}</blockquote></div>

```

It’s run!

But, If the HTML text is into in included file?  
the output is escaped!

I try too, with:

```auto
{{< blockquote "/content/inc/included-file" >}}{{< /blockquote >}}

```

---

<div class="post-metadata">

### Author: ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)
#### Post date: [November 22, 2019, 7:35pm UTC](https://discourse.gohugo.io/t/shortcode-html/21917/4 "2019-11-22T19:35:36Z")

</div>

Try:

```
{{ .Inner | htmlUnescape | safeHTML }}

```

You may have to replace `.Inner` with however you’re reading in the text file.

---

<div class="post-metadata">

### Author: ![hucste](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hucste/32/10014_2.png) [@hucste](https://discourse.gohugo.io/u/hucste)
#### Post date: [November 22, 2019, 8:03pm UTC](https://discourse.gohugo.io/t/shortcode-html/21917/5 "2019-11-22T20:03:45Z")

</div>

> [@zwbetz](#):
>
> {{ .Inner | htmlUnescape | safeHTML }}

Result: empty!

If I wrote as:  
`{{ .Inner }}{{ .Get 0 | htmlUnescape | safeHTML }}`  
This returns the real name string of `/path/to/included-file`but not his content.

Finally, I found quasi-correct as:  
`{{ .Inner }}{{ .Get 0 | readFile | htmlUnescape | safeHTML }}`

* * *

I obtain same result with this shortcode:

```auto
<div class="info-quote"><p class="text-white-50">{{ i18n "quoteTitle" }}</p></div><div class="quote"><blockquote>{{ $file := .Get 0 | readFile | htmlUnescape | safeHTML }}{{ $file }}</blockquote></div>

```

and the call, as:  
`{{% blockquote "/content/inc/included-file" %}}`
