# Goldmark: How to disable autolinks

**URL:** https://discourse.gohugo.io/t/goldmark-how-to-disable-autolinks/30476
**Category:** support
**Created:** [January 7, 2021, 12:43pm UTC](https://discourse.gohugo.io/t/goldmark-how-to-disable-autolinks/30476 "2021-01-07T12:43:16Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ChrisRFLogic](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@ChrisRFLogic](https://discourse.gohugo.io/u/ChrisRFLogic)
#### Post date: [January 7, 2021, 12:43pm UTC](https://discourse.gohugo.io/t/goldmark-how-to-disable-autolinks/30476/1 "2021-01-07T12:43:16Z")

</div>

I have a link shortcode that has an additional target attribute.

\<a href={{ .Get “href” }} target="\_blank"\>{{ .Get “text” }}

When i use this in a md content file, if text is a url it gets expanded to an autolink, this generating two nested links. I have and need unsafe = true .

How can i disable this.

---

<div class="post-metadata">

### Author: ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)
#### Post date: [January 7, 2021, 12:48pm UTC](https://discourse.gohugo.io/t/goldmark-how-to-disable-autolinks/30476/2 "2021-01-07T12:48:46Z")

</div>

Assuming you are using Goldmark — if you don’t understand what I am writing, then YES, you are using Goldmark 😉 — you can set a value in your config.toml:

> **[Configure Markup](https://gohugo.io/getting-started/configuration-markup/)**
>
> How to handle Markdown and other markup related configuration.

```auto
[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      linkify = true

```

Read that page linked above. There is a lot that you can configure based on the markdown parser used.

---

<div class="post-metadata">

### Author: ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)
#### Post date: [January 7, 2021, 12:51pm UTC](https://discourse.gohugo.io/t/goldmark-how-to-disable-autolinks/30476/3 "2021-01-07T12:51:46Z")

</div>

Re-reading your issue I think the config variable might not be what you are looking for. Did you try something like {{ .Get “text” | safeHTML }}?

---

<div class="post-metadata">

### Author: ![ChrisRFLogic](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@ChrisRFLogic](https://discourse.gohugo.io/u/ChrisRFLogic)
#### Post date: [January 7, 2021, 12:53pm UTC](https://discourse.gohugo.io/t/goldmark-how-to-disable-autolinks/30476/4 "2021-01-07T12:53:51Z")

</div>

> [@davidsneighbour](#):
>
> ```auto
> [markup]
> [markup.goldmark]
> [markup.goldmark.extensions]
> linkify = false
> 
> ```

That worked thanks. I had tried that, but i had the config format wrong.  
Many thanks  
Chris

---

<div class="post-metadata">

### Author: ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)
#### Post date: [January 9, 2021, 12:53pm UTC](https://discourse.gohugo.io/t/goldmark-how-to-disable-autolinks/30476/5 "2021-01-09T12:53:53Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
