kivikakk / koino

CommonMark + GFM compatible Markdown parser and renderer
https://hrzn.ee/kivikakk/koino
MIT License
118 stars 13 forks source link

anchor generation #24

Closed kivikakk closed 4 years ago

kivikakk commented 4 years ago

Add anchor generation.

@masterq32 How does this look to you? It vaguely emulates what Comrak did, which in turn is based on GitHub's behaviour, but we don't need to be beholden to any of that as it doesn't fall under spec. Would it be more helpful to just generate the id on the header tags themselves?

Sample:

https://github.com/kivikakk/koino/blob/fc89e09f8a8c524228ace34b75d81b5f396e4923/src/parser.zig#L1155-L1175

ikskuh commented 4 years ago

That looks fine to me