Automatic id attributes for kirby-markdown-editor / kirbytext() headlines

Hello,
is it possible to add automatic slug ids to headlines coming from markdown text fields (rendered via kirbytext() )?
What I want to do is link to a specific headline within a page. Of course I can do this myself with a seperate headline field, but is it possible in a markdown editor field too?

Thanks
Hagen

Check out the anchorheadlines() field method here: https://github.com/getkirby/getkirby.com/blob/master/site/plugins/site/fieldMethods.php

The same can be achieved sort of automatically without calling a method, if you implement the same logic in a KirbyTags:after hook.

ok thanks, I just modified it for h1|h2 and it works perfectly fine!

Thanks
Hagen