Goldmark: How to disable autolinks

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.

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

[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.

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 }}?

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

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