github-markdown-toc.go
github-markdown-toc.go copied to clipboard
Indentation of TOC items prevents github wiki markdown from parsing the links
This will not work (because it is treated as a code block?):
* [Process](#process)
* [Preparing your workstation](#preparing-your-workstation)
* [Known Issues](#known-issues)
* [ERROR\! Unexpected Exception: [Errno 12] Cannot allocate memory](#error-unexpected-exception-errno-12-cannot-allocate-memory)
This will work:
* [Process](#process)
* [Preparing your workstation](#preparing-your-workstation)
* [Known Issues](#known-issues)
* [ERROR\! Unexpected Exception: [Errno 12] Cannot allocate memory](#error-unexpected-exception-errno-12-cannot-allocate-memory)
Looks like the author never answered, but looking at the source code, this tool passes the content to the GitHub API /markdown endpoint. GitHub implements a "GitHub flavor" of Commonmark, and the behavior you're experiencing is documented here: https://github.github.com/gfm/#indented-code-blocks
In short, it looks like the behavior is correct according to the spec. You'd need to alter your Markdown in order for your markup to be parsed as a list as opposed to a code block.