# Render-Link Functionality Not Working

**URL:** <https://discourse.gohugo.io/t/render-link-functionality-not-working/26358>\
**Category:** support\
**Created:** [June 19, 2020, 12:22am UTC](https://discourse.gohugo.io/t/render-link-functionality-not-working/26358 "2020-06-19T00:22:27Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [June 23, 2020, 2:39pm UTC](https://discourse.gohugo.io/t/render-link-functionality-not-working/26358/13 "2020-06-23T14:39:40Z")

</div>

I wish this were a trivial question. It is not. The behavior changed in version 0.55, and again in 0.60.

| Version | Shortcode | Markdown | HTML |
| --- | --- | --- | --- |
| `0.54` | `{{ .Inner }}` | `{{< foo >}} **bold** {{< /foo >}}` | ` **bold** ` |
| `0.54` | `{{ .Inner }}` | `{{% foo %}} **bold** {{% /foo %}}` | `<strong>bold</strong>` |
| `0.54` | `<p>{{ .Inner }}</p>` | `{{< foo >}} **bold** {{< /foo >}}` | `<p> **bold** </p>` |
| `0.54` | `<p>{{ .Inner }}</p>` | `{{% foo %}} **bold** {{% /foo %}}` | `<p><strong>bold</strong></p>` |
| &nbsp; | | | |
| `0.55` | `{{ .Inner }}` | `{{< foo >}} **bold** {{< /foo >}}` | ` **bold** ` |
| `0.55` | `{{ .Inner }}` | `{{% foo %}} **bold** {{% /foo %}}` | `<p><strong>bold</strong></p>` |
| `0.55` | `<p>{{ .Inner }}</p>` | `{{< foo >}} **bold** {{< /foo >}}` | `<p> **bold** </p>` |
| `0.55` | `<p>{{ .Inner }}</p>` | `{{% foo %}} **bold** {{% /foo %}}` | `<p> **bold** </p>` |
| &nbsp; | | | |
| `0.60` | `{{ .Inner }}` | `{{< foo >}} **bold** {{< /foo >}}` | ` **bold** ` |
| `0.60` | `{{ .Inner }}` | `{{% foo %}} **bold** {{% /foo %}}` | `<p><strong>bold</strong></p>` |
| `0.60` | `<p>{{ .Inner }}</p>` | `{{< foo >}} **bold** {{< /foo >}}` | `<p> **bold** </p>` |
| `0.60` | `<p>{{ .Inner }}</p>` | `{{% foo %}} **bold** {{% /foo %}}` | `<!-- raw HTML omitted -->` |

Look at the last line.

The `<!-- raw HTML omitted -->` comment is rendered, _without warning during the build_, due to the [security model](https://gohugo.io/about/security-model/#web-application-security) introduced in Hugo 0.60. In this example, to get the desired output…

Shortcode:

```html
<p>{{ .Inner | markdownify }}</p>

```

And then call it with:

```md
{{< foo >}} **bold** {{< /foo >}}

```

So now we’re in the habit of coding our shortcodes templates this way, and always calling them with the `{{< foo >}}` notation. But there’s another big difference between the two notation styles, introduced in Hugo 0.55. From the release notes:

> Shortcodes using the `{{% %}}` as the outer-most delimiter will now be fully rendered when sent to the content renderer (e.g. Blackfriday for Markdown), meaning they can be part of the generated table of contents, footnotes, etc.

I think this change is what makes it possible to do what you originally asked about: using the output of a shortcode within a render hook.

Comments:

1. Prior to deployment we always `grep` the `public` directory for `<!-- raw HTML omitted -->` and `ZgotmplZ` to find problems that Hugo doesn’t warn us about during build.

2. With Hugo 0.62 and later [.RenderString](https://gohugo.io/functions/renderstring/) is preferable to [`markdownify`](https://gohugo.io/functions/markdownify/):

3. The version 0.60 examples assume default settings (i.e., you have not overridden default security settings in `config.toml`).

4. If you find this confusing you are not alone. The existing documentation is insufficient, but I’m not sure anyone understands the functionality/cases well enough to rewrite it.

---

_[View the full topic](https://discourse.gohugo.io/t/render-link-functionality-not-working/26358)._
