Adds a link fixer/checker to mungedocs.

Links that don't work yet can be prefixed with "TODO:" to avoid the check.
This commit is contained in:
Daniel Smith
2015-07-09 16:52:03 -07:00
parent affba42a05
commit c4aab16b04
4 changed files with 189 additions and 36 deletions

View File

@@ -92,7 +92,7 @@ func Test_updateTOC(t *testing.T) {
"# Title\nLorem ipsum \n**table of contents**\n<!-- BEGIN GENERATED TOC -->\n- [Title](#title)\n - [Section Heading](#section-heading)\n\n<!-- END GENERATED TOC -->\n## Section Heading\ndolor sit amet\n"},
}
for _, c := range cases {
actual, err := updateTOC([]byte(c.in))
actual, err := updateTOC("filename.md", []byte(c.in))
assert.NoError(t, err)
if c.out != string(actual) {
t.Errorf("Expected TOC '%v' but got '%v'", c.out, string(actual))