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.

[BUG] Anchors may have invalid chars that break the links #30

@Fred-Vatin

Description

@Fred-Vatin
VS Code version OS Extension version
1.14.0 Win 10 x64 pro (french) 14393 0.8.1

Steps to reproduce

Use extension to create/update the TOC will produce this:

<!-- TOC -->

- [Valid link](#valid-link)
- [Invalid _link_](#invalid-_link_)
- [Another invalid link ([a link](https://link.com))](#another-invalid-link-a-linkhttpslinkcom)

<!-- /TOC -->

<a id="markdown-valid-link" name="valid-link"></a>
## Valid link

<a id="markdown-invalid-_link_" name="invalid-_link_"></a>
## Invalid _link_


<a id="markdown-another-invalid-link-a-linkhttpslinkcom" name="another-invalid-link-a-linkhttpslinkcom"></a>
## Another invalid link ([a link](https://link.com))

Results

Second and third links are broken in TOC.

Expectations

Extension must remove invalid chars such as _ or links in title to build valid reference targets. So the code above should be:

<!-- TOC -->

- [Valid link](#valid-link)
- [Invalid _link_](#invalid-link)
- [Another invalid link (a link)](#another-invalid-link)

<!-- /TOC -->

<a id="markdown-valid-link" name="valid-link"></a>
## Valid link

<a id="markdown-invalid-link" name="invalid-link"></a>
## Invalid _link_

<a id="markdown-another-invalid-link" name="another-invalid-link"></a>
## Another invalid link ([a link](https://link.com))

Note: the third link still won't work in VSCode but do in GitHub.

Regards

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions