Resolves #124 - Broken links to sections in TOC

I've added a test with this to verify it. The test passes for this case, but I'm not sure if there are other scenarios that would break it or not (could there be TOC entries for sections in other files? There isn't in this test file at least)