Skip to content

Latest commit

 

History

History
227 lines (177 loc) · 9.82 KB

testing.md

File metadata and controls

227 lines (177 loc) · 9.82 KB
title subtitle author date lang document-css css
testing.md
Testing edge cases for gh-toc
Matthias C. Hormann, a.k.a. Moonbase59
2024-04-08
en
true
gh-toc.css

gh-toc

These are some testing samples for gh-toc.

Let’s check if these coincide with whatever GitHub Markdown comes up with!

The generated ToC (copy-pasted)

Foreign characters

Accents: äöüßÄÖÜẞ áéíóú ÁÉÍÓÚ àèìòù ñÑõÕ çÇ øØ

Russian: Какой-то русский текст…

Numbers: 0123 ⑴⑵⑶ ⅰ ⅱ ⅲ Ⅰ Ⅱ Ⅲ ²³ ¼½

Underscore within code tags

Some code_with_underscores += a*b

More code_bars

We might have double_quoted_code

Or even double-quoted with single backticks ` inside!

Underscore special cases

Just __ some underlines, or dunders

___

__

dunder

emphasis

_ emph _

in a sentence

in_word_parsing

another_in_word_example

Markdown

You can backlink to your generated Table of Contents anywhere using

[Table of Contents](#toc)

Some emphasized text

Some bold text

Some strikethrough text

Anchors {#anchors}

Anchors

More character codes

Apostrophes and such: "a" 'b' “c” ‘d’ »e« ›f‹ „g“ ‚h‘

(Parentheses), [brackets] and {curlies}

Arrows: ←↓↑→ ↕⇵ ⏎

Symbols: ☯ ☎ 🂡

Currency: $ € £ ₽ ¤

Other: ℗©™

Repeated Headings

Repeated headings auto-generate links with appended numbers, like -1, -2, etc.

Heading

This will generate the link #heading.

Heading

This generates #heading-1.

Heading

This generates #heading-2.

Heading 2

This would generate #heading-2, but since that has been used already, it now generates #heading-2-1.

Heading

This generates #heading-3 as expected.

Numbered Headings

3. A section

3.1 Sub-section

3.1.1 Sub-sub-section
3.1.2 Sub-sub-section
3.1.3 Sub-sub-section

3.2 Sub-section

3.2.1 Sub-sub-section
3.2.2 Sub-sub-section
3.2.3 Sub-sub-section

Code blocks

## What if this is in a code block?
```
## Code level 3 inside level 5 block
```
```
## Code level 3 inside level 4 block, no level 3 end
## Code tag with name
## fenced code block starting with 4, ending with 6 tildes
## 3-space indented code block
``` not a fenced code block but still a code block (4 spaces)
## 4-space indent—treat as code
```

## This is an indented code block (4+ spaces)
More text here (also "code").

Back again from the code blocks

Indentation (4+ spaces is code)

None

1 space

2 spaces

3 spaces

### 4 spaces, empty line before (consider as code)

Lots of characters normally not in headings, but they shouldn’t break link generation.

Dummy text so we can see the browser jump to the desired heading

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.

Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean imperdiet. Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas tempus, tellus eget condimentum rhoncus, sem quam semper libero, sit amet adipiscing sem neque sed ipsum. Nam quam nunc, blandit vel, luctus pulvinar, hendrerit id, lorem. Maecenas nec odio et ante tincidunt tempus. Donec vitae sapien ut libero venenatis faucibus. Nullam quis ante. Etiam sit amet orci eget eros faucibus tincidunt. Duis leo. Sed fringilla mauris sit amet nibh. Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien.

Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui. Cras ultricies mi eu turpis hendrerit fringilla. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In ac dui quis mi consectetuer lacinia. Nam pretium turpis et arcu. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Sed aliquam ultrices mauris. Integer ante arcu, accumsan a, consectetuer eget, posuere ut, mauris. Praesent adipiscing. Phasellus ullamcorper ipsum rutrum nunc. Nunc nonummy yesmummy canbare metus. Vestibulum volutpat pretium libero. Cras id dui. Aenean ut eros et nisl sagittis vestibulum. Nullam nulla eros, ultricies sit amet, nonummy id, imperdiet feugiat, pede.

Sed lectus. Donec mollis hendrerit risus. Phasellus nec sem in justo pellentesque facilisis. Etiam imperdiet imperdiet orci. Nunc nec neque. Phasellus leo dolor, tempus non, auctor et, hendrerit quis, nisi. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Maecenas malesuada. Praesent congue erat at massa. Sed cursus turpis vitae tortor. Donec posuere vulputate arcu. Phasellus accumsan cursus velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed aliquam, nisi quis augue porttitor congue, elit erat euismod orci, ac placerat dolor lectus quis orci. Phasellus consectetuer vestibulum elit. Aenean tellus metus, bibendum sed, posuere ac, mattis non, nunc. Vestibulum fringilla pede sit amet augue. In turpis. Pellentesque posuere. Praesent turpis. Aenean posuere, tortor sed cursus feugiat, nunc augue blandit nunc, eu sollicitudin urna dolor sagittis lacus. Donec elit libero, sodales nec, volutpat a, suscipit non, turpis. Nullam sagittis. Suspendisse pulvinar, augue ac venenatis condimentum, sem libero volutpat nibh, nec pellentesque velit pede quis nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce id purus. Ut varius tincidunt libero. Phasellus dolor.

Enjoy!