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

TOC doesn’t understand between comment in code and h1 header #77

Open BuonOmo opened 7 years ago

BuonOmo commented 7 years ago

If you have a piece of code, for install ruby or sh like this:

# my function is nice
def my_function ()
    "I’m nice"
end

TOC will interpret 'my function is nice' as a h1 header.

B-Galati commented 7 years ago

@BuonOmo Yea I have the same problem. As a workaound you can add a space before your comment.. not sexy at all but it does the job :-)

BuonOmo commented 7 years ago

Nice hack! But I was more looking of a way to fix it :stuck_out_tongue: