mzlogin / vim-markdown-toc

A vim 7.4+ plugin to generate table of contents for Markdown files.
http://www.vim.org/scripts/script.php?script_id=5460
MIT License
613 stars 59 forks source link

allow headings to contain a space after the hashes #9

Closed scrooloose closed 8 years ago

scrooloose commented 8 years ago

Previously the algorithm couldn't handle headings like this:

# heading with a leading space

It could only handle headings like this:

#no leading space

Add support for the former.

Note: I looked around on the internet to see if leading spaces were illegal in the syntax, but I couldn't find anything definitive - and github renders it fine regardless. So I guess this is legal.

scrooloose commented 8 years ago

Opps! I wrote that commit message the wrong way around! Will submit a fixed version... ignore this fail :)