huntertran / markdown-toc

Auto MarkdownTOC (Table Of Contents) plugin for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=huntertran.auto-markdown-toc
MIT License
39 stars 25 forks source link

Ignore option does not work #40

Closed rakuzen25 closed 4 years ago

rakuzen25 commented 4 years ago

I've seen the documentation and #23, but am still confused about how I can ignore a header.

This is how it currently renders my document:

<!-- TOC ignore:true -->
# Table of Contents
<!-- TOC -->
- [Table of Contents](#table-of-contents)
- [Part 1](#part-1)
<!-- /TOC -->

# Part 1
Some content here.

However, what I wish to do is this:

<!-- TOC ignore:true -->
# Table of Contents
<!-- TOC -->
- [Part 1](#part-1)
<!-- /TOC -->

# Part 1
Some content here.

I can achieve that by using <h1> manually, but it's kind of annoying.

Any ideas how to solve that?

huntertran commented 4 years ago

I'm investigating this issue

huntertran commented 4 years ago

I think this is fixed in v3.0.12

rakuzen25 commented 4 years ago

Thanks! When will this version be released to the marketplace?

huntertran commented 4 years ago

It is published now. Maybe 1-2 hours more.

rakuzen25 commented 4 years ago

Hmm, it seems like there is another bug.

How do I put this...

Say, I have this document:

<!-- TOC ignore:true -->
# Table of Contents
<!-- TOC orderedlist:true -->
- [Part 1](#part-1)
<!-- /TOC -->

# Part 1
Some content here.

When I click update from the context menu, it automatically becomes this:

<!-- TOC ignore:true -->
# Table of Contents
<!-- TOC -->
- [Part 1](#part-1)
<!-- /TOC -->

# Part 1
Some content here.

And it does not change to an ordered list. It just ignores my setting.

Any idea how to solve that other than manually removing the ignored header and adding it back afterwards?

huntertran commented 4 years ago

This is because the extension cannot differentiate the first <!--TOC orderedlist:true--> with <!-- TOC ignore:true -->. So you will need to set up in a way that the block

<!-- TOC -->
<!--\TOC-->

should be in the document before any headings