Make MUNGE generated table of contents (TOC) bookmark work when there are symbols in the headline

This commit is contained in:
Janet Kuo
2015-07-15 11:26:51 -07:00
parent 8f3c3108b8
commit de755bf59b
13 changed files with 23 additions and 16 deletions

View File

@@ -37,6 +37,10 @@ func Test_buildTOC(t *testing.T) {
"# Title\nLorem ipsum \n## Section Heading\ndolor sit amet\n```bash\n#!/bin/sh\n```",
"- [Title](#title)\n - [Section Heading](#section-heading)\n",
},
{
"# Title\nLorem ipsum \n## Section Heading\n### Why doesn't this work?\ndolor sit amet\n",
"- [Title](#title)\n - [Section Heading](#section-heading)\n - [Why doesn't this work?](#why-doesnt-this-work)\n",
},
}
for _, c := range cases {
actual, err := buildTOC([]byte(c.in))