fix anchors in TOC for headings with 2+ spaces

For example, "Sample acceptance test" produces anchor name "#Sample-acceptance test" which is incorrect, so links don't work.