count only leaf nodes of toc tree when level is zero
Merge pull request #984 from chrox/collapsible_toc

count only leaf nodes of toc tree when level is zero