nok / markdown-toc

Generate and update magically a table of contents based on the headlines of a parsed markdown file.
MIT License
68 stars 37 forks source link

lowercase fragment may not work in all markdown renderers #106

Open jtmoon79 opened 6 years ago

jtmoon79 commented 6 years ago

Problem

A generated TOC entry will have a lowercased fragement.

e.g. given markdown

## Hello2

markdown-toc will generate markdown

- [Hello2](#hello2)

Some markdown renderers will not match the lowercase hello2 to the Capitalized string in the h2 header, e.g. <h2>Hello2</h2>. Clicking the Table Of Contents entry Hello2 will do nothing.

Solution

Add an option to disable lowercasing. Something like lowercase:1 would enable lowercasing the fragment. lowercase:0 would disable lowercasing the fragement.

e.g.

<!-- TOC lowercase:0 depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->

or

<!-- TOC lowercase:1 depthFrom:1 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->