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

Invalid anchor links with identical headlines #37

Open
janpio opened this issue Oct 19, 2017 · 4 comments · May be fixed by #92
Open

Invalid anchor links with identical headlines #37

janpio opened this issue Oct 19, 2017 · 4 comments · May be fixed by #92

Comments

@janpio
Copy link

janpio commented Oct 19, 2017

# 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.

@alanwalk
Copy link
Owner

alanwalk commented Apr 9, 2018

The default anchor mode is github.com, vscode's default preview is not same mode.

@janpio
Copy link
Author

janpio commented Apr 9, 2018

Meaning what exactly?

@alanwalk
Copy link
Owner

alanwalk commented Apr 10, 2018

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

image

@mcornella
Copy link

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

@mcornella mcornella linked a pull request Sep 23, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants