Is this a hackmd.io issue?
Read our Official tutorial
It's on https://hackmd.io/c/tutorials/
or Chinese version: https://hackmd.io/c/tutorials-tw/
What's the problem
Current behaviour
When using [TOC], headings written inside list items are also included in the table of contents.
Reproducible content:
[TOC]
### Section
- ### Case1
- ### Case2
- ### Case3
Actual rendered TOC result:
- Section
- Case1
- Case2
- Case3
Provide steps to reproduce:
-
Go to https://hackmd.io
-
Create a new note
-
Paste the content below:
[TOC]
### Section
- ### Case1
- ### Case2
- ### Case3
-
Switch to preview / rendered view
-
Observe that Case1, Case2, and Case3 are also included in TOC
Here is an example: https://hackmd.io/mhkr3m9WR4Kse_ePoV_c6w
(This never happened before.)
Expected behaviour
I would expect only the main section heading to appear in the table of contents:
Headings inside list items such as - ### Case1 should ideally not be included in TOC, or this behavior should be clearly documented if it is intended.
Environment
I use HackMD on:
Desktop
- OS: Windows / Ubuntu 24.04 / Android 14
- Browser: Chrome 147.0.7727.56 , FireFox 143.0(64 位元)
Mobile
- Device: Xiaomi Pro 13
- OS: Android 14
- Browser: Chrome 146.0.7880.177
Additional context
This may be intended Markdown parsing behavior, but from a TOC usability perspective it is surprising and can pollute the generated table of contents.
If this is expected behavior, documentation clarification would be helpful.
Is this a hackmd.io issue?
Read our Official tutorial
It's on https://hackmd.io/c/tutorials/
or Chinese version: https://hackmd.io/c/tutorials-tw/
What's the problem
Current behaviour
When using
[TOC], headings written inside list items are also included in the table of contents.Reproducible content:
Actual rendered TOC result:
Provide steps to reproduce:
Go to https://hackmd.io
Create a new note
Paste the content below:
Switch to preview / rendered view
Observe that
Case1,Case2, andCase3are also included in TOCExpected behaviour
I would expect only the main section heading to appear in the table of contents:
- SectionHeadings inside list items such as
- ### Case1should ideally not be included in TOC, or this behavior should be clearly documented if it is intended.Environment
I use HackMD on:
Desktop
Mobile
Additional context
This may be intended Markdown parsing behavior, but from a TOC usability perspective it is surprising and can pollute the generated table of contents.
If this is expected behavior, documentation clarification would be helpful.