github-markdown-toc.go icon indicating copy to clipboard operation
github-markdown-toc.go copied to clipboard

Indentation of TOC items prevents github wiki markdown from parsing the links

Open fortran02 opened this issue 8 years ago • 1 comments

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)

fortran02 avatar Oct 02 '17 14:10 fortran02

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.

skyzyx avatar Aug 24 '20 02:08 skyzyx