github - What are the rules of converting one markdown title into an HTML anchor? -


i need generate long readme.md file , links different sections table of contents in beginning. markdown translates section headings links:

this heading , link in markdown

in order generate link table of content, need values anchor. text have. fragment need rules. be:

[this heading , link in markdown](#thisisaheadingandalinkinmarkdown) 

does know rules how headings in markdown converted anchor/fragment values?

the gitlab documentation states how creates anchors markdown headers:

  1. all text converted lowercase
  2. all non-word text (e.g., punctuation, html) removed
  3. all spaces converted hyphens
  4. two or more hyphens in row converted one
  5. if header same id has been generated, unique incrementing number appended, starting @ 1.

this means anchor # standard markdown converted standard-markdown

while couldn't find clear cut rules, on how github generates anchors seems checking few readme.md of rules above apply github aswell.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -