ardumont / markdown-toc

Generate a TOC in markdown file
GNU General Public License v3.0
127 stars 102 forks source link

Distinguishes between duplicate titles #37

Closed sdwolfz closed 7 years ago

sdwolfz commented 7 years ago

Github, Gitlab, Gogs and other git hosting sites that parse a README.md file and display it as HTML deal with duplicate header names by appending their anchors with a number.

Note that this is just something I hacked one late evening and another early morning so I'm aware it's not the best implementation. Feel free to tell me how things can be improved.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 98.75% when pulling 685b3d403cb1c0f2a0595abc907d33231ba62370 on sdwolf:feature/github-markdown-links into 140e612e5e56295edfd3740329995e7aa1375c0f on ardumont:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.2%) to 98.75% when pulling e4dec79e014bc248364336b6ad3d4a20258575af on sdwolf:feature/github-markdown-links into 140e612e5e56295edfd3740329995e7aa1375c0f on ardumont:master.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+1.4%) to 100.0% when pulling 689888be829a5339b19664b3d500f48e64f8abea on sdwolf:feature/github-markdown-links into 140e612e5e56295edfd3740329995e7aa1375c0f on ardumont:master.

sdwolfz commented 7 years ago

I've also added a test for the markdown-toc-version function. This should make the coverage 100% 🎉 .

ardumont commented 7 years ago

Github, Gitlab, Gogs and other git hosting sites that parse a README.md file and display it as HTML deal with duplicate header names by appending their anchors with a number.

Right.

Note that this is just something I hacked one late evening and another early morning so I'm aware it's not the best implementation. Feel free to tell me how things can be improved.

Well, it's good enough for me right now. Plus, now we have all the tests so we can refactor when we'll feel the need to :)

Thanks a lot.

Cheers,