alanwalk / markdown-toc

MarkdownTOC(Table Of Contents) Plugin for Visual Studio Code.
MIT License
141 stars 111 forks source link

Anchor tags ID & name attributes should have same value #95

Open gmccullo opened 3 years ago

gmccullo commented 3 years ago

When using insertAnchor:true the generated anchor tags have different ID & name attribute values. The link points to the name value, not the ID value. This causes validation errors on bad links. The ID and Name should have the same value, and the link should point to it. For example:


<!-- TOC depthFrom:3 insertAnchor:true -->
- [Theatres. Clubs. Churches. Schools.](#theatres-clubs-churches-schools)
<!-- TOC -->

<a id="markdown-theatres-clubs-churches-schools" name="theatres-clubs-churches-schools"></a>
#### Theatres. Clubs. Churches. Schools.

Should be:


<!-- TOC depthFrom:3 insertAnchor:true -->
- [Theatres. Clubs. Churches. Schools.](#theatres-clubs-churches-schools)
<!-- TOC -->

<a id="theatres-clubs-churches-schools" name="theatres-clubs-churches-schools"></a>
#### Theatres. Clubs. Churches. Schools.