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

Hash in code block used for TOC entry #88

Open andioz opened 7 years ago

andioz commented 7 years ago

I have a text, where I use a code block for 'sh' to show a shell script. First line of the script is the typical Shebang line. This is used by markdown-toc to generate a wrong TOC line.

Can I escape the hash character in the code block or is there another workaround? In general I guess code blocks should be ignored.

chruxin commented 7 years ago

Hey, I think this has already been fixed, it's just the owner hasn't published the fixed version.

If you follow the instructions here -- clone this repo, install dependencies link to this repo -- and then try to generate TOC in a Markdown file with hashtag comments in a code block, the code block comments should be ignored completely.