mity / md4c

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

Heading auto identifier #175

Open chowette opened 2 years ago

chowette commented 2 years ago

This PR implement an extension when generating heading. This make possible to link directly to heading. Github, Pandoc and other Markdown libs provide this feature.

Because this is an extension, there is a flag and a command line switch to enable it. MD_FLAG_HEADINGAUTOID and corresponding --fheading-auto-id are added

This PR is a work in progress and the tasks remaining are:

Add TOC option to the parser parameter struct for md_parse() and md_html()

codecov[bot] commented 2 years ago

Codecov Report

Merging #175 (a41ab75) into master (e9ff661) will increase coverage by 0.04%. The diff coverage is 92.70%.

@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
+ Coverage   94.32%   94.36%   +0.04%     
==========================================
  Files           3        3              
  Lines        3100     3496     +396     
==========================================
+ Hits         2924     3299     +375     
- Misses        176      197      +21     
Impacted Files Coverage Δ
src/md4c.c 94.27% <92.53%> (+0.04%) :arrow_up:
src/md4c-html.c 95.36% <100.00%> (+0.16%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.