markdown-toc
                                
                                 markdown-toc copied to clipboard
                                
                                    markdown-toc copied to clipboard
                            
                            
                            
                        Invalid anchor links with identical headlines
# h1
<!-- TOC -->
- [h1](#h1)
    - [Headline](#headline)
    - [Different Headline](#different-headline)
    - [Headline](#headline-1)
<!-- /TOC -->
## Headline
text
## Different Headline
text
## Headline
text
The second "Headline" link doesn't work in the Preview.
I couldn't figure out what the actual correct anchor for that headline would be, or if it even also is #headline.
The default anchor mode is github.com, vscode's default preview is not same mode.
Meaning what exactly?
Hi, Markdown-TOC can't support vscode's preview.
Because vscode use markdown-it & markdown-it-named-headers to render Markdown.
I have no way to distinguish the same header with render result.
I had create a issue to vscode.
I'm sorry for it, thank you for your understanding.
source code link : https://github.com/Microsoft/vscode/blob/468dc867cdeb75bddc1e4fa965ea1df97e4782ea/extensions/markdown-language-features/src/markdownEngine.ts

Tested in current VS Code: the preview now works the same way as github.com. This can be closed.