Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example table of contents generated by markdown-toc, correctly links repeated headings.
@sarossell
Copy link

sarossell commented Mar 20, 2018

Thanks for the example. Unfortunately, my experience with the code showed that the lower case TOC anchor links did not match up with the Initial upper case header anchors. I had to change the case of the TOC links to initial upper for it to work.

@salmankhwaja
Copy link

salmankhwaja commented Apr 26, 2018

Also, what is the method to include the links for Headings with SPACEs. for example, "This is a heading"

@salmankhwaja
Copy link

salmankhwaja commented Apr 26, 2018

Got it. Beautiful thing.

@LrWm3
Copy link

LrWm3 commented Nov 12, 2018

Got it. Beautiful thing.

For anyone else wondering how to include spaces in headings:

- [Example 1 Heading](###Example%201%20Heading)

### Example 1 Heading

Example of heading with space

Example 1 Heading

Example of heading with space

@pleiades-s
Copy link

pleiades-s commented Dec 16, 2019

- [Example 1 Heading](###Example-1-Heading)
 
### Example 1 Heading

Using '-' for blanks works for me.

Example 1 Heading

Using '-' for blanks works for me.

@AvgustPol
Copy link

AvgustPol commented Oct 22, 2020

thanks <3

@matrixtribe
Copy link

matrixtribe commented Dec 6, 2020

What about using heading numbers?

  1. Introduction
    1.1 Purpose
    1.2 Description
  2. Development toolset
    2.1 IDEs
    2.2 Continuous Integration tools
    etc...

nm, got it!!

- [1. Introduction](#1-introduction)
  * [1.1 Purpose](#11-purpose)
  * [1.2 Scope](#12-scope)
  * [1.3 Acronyms](#13-acronyms)
  * [1.4 References](#14-references)
    + [1.4.1 Internal References](#141-internal-references)
    + [1.4.2 External References](#142-external-references)
  * [1.5 Overview](#15-overview)

@Aybak3k
Copy link

Aybak3k commented Apr 24, 2021

THX A LOT!!!!

@Badboy1307
Copy link

Badboy1307 commented May 31, 2021

Thanks a ton.

@VictoriaChoy
Copy link

VictoriaChoy commented Jul 18, 2022

TKS!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment