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:
- all text converted lowercase
- all non-word text (e.g., punctuation, html) removed
- all spaces converted hyphens
- two or more hyphens in row converted one
- 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
Post a Comment