# Can I prevent markdownify to introduce 'id' for headers?

**URL:** <https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521>\
**Category:** support\
**Created:** [July 7, 2019, 3:33pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521 "2019-07-07T15:33:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ypujante](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ypujante/32/9065_2.png) [@ypujante](https://discourse.gohugo.io/u/ypujante)\
**Post date:** [July 7, 2019, 3:33pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/1 "2019-07-07T15:33:44Z")

</div>

I have created the following shortcode to pull release notes from my github repo (very powerful!)

```auto
{{ $releases := getJSON "https://api.github.com/repos/pongasoft/jamba/releases?per_page=100" }}
{{ range sort $releases "created_at" "desc"}}
<section class="release-note">
<h3><a href="https://github.com/pongasoft/jamba/tree/{{ .tag_name }}">{{ dateFormat "2006-01-02" .created_at }} - {{ .tag_name }}</a></h3>
{{ .body | markdownify }}
</section>
{{ end }}

```

In the release notes, I end up having sections like:

```markdown
## Warning
### The following changes are potentially breaking changes

```

which when run through `markdownify` generates the following html

```auto
<h2 id="warning">WARNING</h2>

<h3 id="the-following-changes-are-potentially-breaking-changes">The following changes are potentially breaking changes</h3>

```

Since I have multiple release notes with the same kind of warning, I end up with an html page having multiple tags with the same id…

Is there a way to prevent `markdownify` to not generate those ids?

Thanks  
Yan

---

<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:** [July 7, 2019, 3:40pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/2 "2019-07-07T15:40:57Z")

</div>

Play around with

```auto
[blackfriday]
      plainIDAnchors = true

```

in your configuration. Either `true` or `false` add a series of unique characters in the ID attribute.

---

<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:** [July 7, 2019, 3:42pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/3 "2019-07-07T15:42:24Z")

</div>

I think it’s `false` that you need to use:

> **[Supported Content Formats](https://gohugo.io/content-management/formats/#blackfriday-options)**
>
> Both HTML and Markdown are supported content formats.

---

<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:** [July 7, 2019, 3:43pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/4 "2019-07-07T15:43:37Z")

</div>

Last addendum: Your initial request was how to disable those IDs… that can be done via `autoHeaderIds` option, same link as above.

---

<div class="post-metadata">

**Author:** ![ypujante](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ypujante/32/9065_2.png) [@ypujante](https://discourse.gohugo.io/u/ypujante)\
**Post date:** [July 7, 2019, 5:10pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/5 "2019-07-07T17:10:37Z")

</div>

Thank you for your answer. I guess I am probably doing it wrong because I cannot make it work…

I added this line to my `config.toml` file:

```auto
autoHeaderIds=false

```

And it is the same.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [July 7, 2019, 5:49pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/6 "2019-07-07T17:49:08Z")

</div>

> [@ypujante](#):
>
> autoHeaderIds=false

I’d put spaces in, see if that helps.

```auto
autoHeaderIds = false

```

---

<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:** [July 7, 2019, 6:15pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/7 "2019-07-07T18:15:12Z")

</div>

It also needs to be nested under:

```
[blackfriday]
```

---

<div class="post-metadata">

**Author:** ![ypujante](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ypujante/32/9065_2.png) [@ypujante](https://discourse.gohugo.io/u/ypujante)\
**Post date:** [July 8, 2019, 2:55pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/8 "2019-07-08T14:55:19Z")

</div>

I have tried all suggestions:

```auto
[blackfriday]
autoHeaderIds = false

```

Nothing works… I am wondering if for some reason calling `markdownify` vs having a `.md` file which gets processed automatically is somehow the source of the problem… I wished there was a way to invoke `markdownify` with parameters so that I could just do:

```auto
{{ .body | markdownify autoHeaderIds=false }}

```

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [July 8, 2019, 3:01pm UTC](https://discourse.gohugo.io/t/can-i-prevent-markdownify-to-introduce-id-for-headers/19521/9 "2019-07-08T15:01:05Z")

</div>

> [@ypujante](#):
>
> I have tried all suggestions

Please read [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132) and share a repo.
