Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.
This repository was archived by the owner on May 27, 2021. It is now read-only.

Ignore comments that don't start with TOC #50

@movermeyer

Description

@movermeyer

I wanted to add an attribution to my TOC, so people knew that I used Markdown TOC to generate it.

<!-- Generated with "Markdown TOC" extension for Visual Studio Code -->
<!-- TOC -->
- [Version 2.0.1](#version-201)
- [Version 2.0.0](#version-200)
    - [Breaking changes](#breaking-changes)

<!-- /TOC -->

But this didn't work, since Markdown TOC looks for any comment that has TOC anywhere in the comment. It stripped the comment entirely.

Surpisingly, it doesn't even have to be upper case, nor a separate word:

<!-- This is the README for the stockfish project -->
<!-- TOC -->
- [Version 2.0.1](#version-201)
- [Version 2.0.0](#version-200)
    - [Breaking changes](#breaking-changes)
<!-- /TOC -->

It still stripped the comment entirely, despite TOC only appearing in "stockfish"

I would like for Markdown TOC to:

  1. Ignore comments that don't start with TOC
    • Perhaps match the regex <!--\s*TOC
    • Perhaps match case sensitive (unless there is a reason not to)

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