hackmdio / hackmdio/codimd

creating multiple TOCs can cause id conflicts

Open
#1,533 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.1k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

When I was playing with multiple TOCs for #1532 I've noticed, that creating multiple TOCs in conjunction with headings e.g. named "toc2" can create ID conflicts within the document, leading to some parts not being rendered correctly. I assume, that this can only be fixed by adding some sort of HTML ID management system, but nonetheless.

```md
# h1

## toc2

[toc]

## h2

### h3

### toc3

[toc]

#### h4

#### toc4

[toc]

##### h5

###### h6
```
![codimd-toc-issue](https://user-images.githubusercontent.com/16545968/83662497-dba01d80-a5c7-11ea-9b34-d5ac865e908d.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.