Skip to content

Including a title in the table of contents even though a given header is within indented code blocks #3

Description

@pavelexpertov

I use your module to generate table of contents within README.md for documentation (of course).

I spotted an interesting bug where if a code section is indented by a single space character, the hashtags (i.e. comments within a shell script) will be included in the generated table of contents.

So for example:

// Imagine the single back tick represents three backticks to make the section code 
 `
 # My comment for the code
 echo "Hello this is my example"
 `

Would make the comment to be included in the table of contents.

So the solution was to unindent the whole block, but since it's a very unnoticable issue, would it be possible to make the parser to identify that it is a code block no matter how indented it is?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions