mity / md4c

C Markdown parser. Fast. SAX-like interface. Compliant to CommonMark specification.
MIT License
776 stars 146 forks source link

Get source line number for headings #45

Closed feinstaub closed 5 years ago

feinstaub commented 5 years ago

Hello, is it possible to retrieve the source line number for headings? I would like to build a parser which can create a TOC with navigation feature for a markdown editor.

mity commented 5 years ago

It would be nice feature, but right now, it is not implemented.

It should be possible, with relatively small effort, to add some info about offsets into the callbacks. Adding support for line numbers is doable too, but it would require more work.

If you are willing to work on either of it, I can offer you some guidance, but I do not currently enough time to implement it myself.

feinstaub commented 5 years ago

Thanks for offering help on implementing such a feature. For now, it is fine to close the ticket because I also have not the time myself.