# Extending markdown parser

**URL:** <https://forum.getkirby.com/t/extending-markdown-parser/18427>\
**Category:** Questions\
**Tags:** v3\
**Created:** [June 4, 2020, 1:51pm UTC](https://forum.getkirby.com/t/extending-markdown-parser/18427 "2020-06-04T13:51:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bruno/32/6422_2.png) [@bruno](https://forum.getkirby.com/u/bruno)\
**Post date:** [June 4, 2020, 1:51pm UTC](https://forum.getkirby.com/t/extending-markdown-parser/18427/1 "2020-06-04T13:51:00Z")

</div>

I need to have all html headlines on text on a webpage to have distinct IDs – Is it possible to rewrite the markdown parsing in a plugin in order to achieve this:

```markdown
## Headline

```

becomes

```auto
<h2 id="headline">Headline</h2>

```

or do I need to use a custom kirbytag?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 4, 2020, 1:53pm UTC](https://forum.getkirby.com/t/extending-markdown-parser/18427/2 "2020-06-04T13:53:55Z")

</div>

> **[Of anchors and ToCs, part 1](https://getkirby.com/docs/cookbook/extensions/table-of-contents#replace-headlines-with-anchors)**
>
> Auto-replace headlines with anchors and generate a table of contents

If you can’t rely on unique headlines, you could add a unique hash…

---

<div class="post-metadata">

**Author:** ![bruno](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bruno/32/6422_2.png) [@bruno](https://forum.getkirby.com/u/bruno)\
**Post date:** [June 4, 2020, 2:22pm UTC](https://forum.getkirby.com/t/extending-markdown-parser/18427/3 "2020-06-04T14:22:48Z")

</div>

wow great, couldn’t find this cookbook page when i was searching for it earlier. thanks a lot!
