# Markdown edge cases

Free sample from 99helpers.com/file-types/md. Each section is something
that renders differently depending on the Markdown flavour. The comment
above each one says what CommonMark and GitHub (GFM) do.

<!-- CommonMark and GFM: one paragraph "Line one Line two". Some apps (and GitHub comments) show a line break. -->
## 1. A single line break

Line one
Line two

<!-- Intraword underscores are not emphasis in CommonMark or GFM. The original Markdown.pl italicised them. -->
## 2. Underscores inside words

snake_case_variable_name and file_name_v2.txt

<!-- Table: GFM only. CommonMark shows the pipes as text. Leading and trailing pipes are optional in GFM. -->
## 3. A table without outer pipes

Name | Score
--- | ---
Ada | 10
Grace | 9

<!-- GFM autolinks a bare www. or https:// address. CommonMark needs <angle brackets>. -->
## 4. A bare URL

Visit https://99helpers.com or www.example.com for details.

<!-- GFM spec and GitHub: both are strikethrough (some GFM tools only accept double). CommonMark shows the tildes. -->
## 5. Strikethrough

~~double tildes~~ and ~single tildes~

<!-- CommonMark: a list can interrupt a paragraph only if it starts with 1 (or is a bullet). -->
## 6. A numbered line inside a paragraph

The year was
1984. Nothing happened.

The steps are
1. this one starts a list.

<!-- Nested lists: the child must line up with the parent's text. Two spaces work under "- "; under "1. " you need three. -->
## 7. Nesting depth

1. Parent item
  - two spaces in: NOT nested in CommonMark, it starts a new list

1. Parent item
   - three spaces in: nested

<!-- `1)` is a valid ordered-list marker in CommonMark and GFM, not in Markdown.pl. -->
## 8. Parenthesis list markers

1) first
2) second

<!-- Not in CommonMark or GFM: math, emoji shortcodes, wiki links, heading IDs. Specific apps add them. -->
## 9. Extensions only some apps support

Inline math: $E = mc^2$ (GitHub, Obsidian and Pandoc's own Markdown, among others)

Emoji shortcode: :tada: (GitHub, many chat apps)

Wiki link: [[Another note]] (Obsidian and other note apps)

### A heading with a custom ID {#custom-id}

(Custom heading IDs: Pandoc, PHP Markdown Extra, kramdown.)

<!-- A heading needs a space after #. CommonMark: "#5" is a paragraph. Markdown.pl made it a heading. -->
## 10. No space after the hash

#5 on the list
#hashtag

<!-- Raw HTML: CommonMark passes it through. GitHub strips script, style, iframe and similar tags. -->
## 11. Raw HTML

<span style="color: red">Red text, if inline styles survive</span>

<script>document.write("Scripts run only if the renderer lets them through")</script>

<!-- HTML block ends at a blank line. Without one, the Markdown below would be treated as HTML. -->
<div>

**Bold inside a div**, because of the blank lines around it.

</div>

<!-- Two trailing spaces make a hard break; many editors strip trailing spaces on save. -->
## 12. Trailing spaces

This line ends with two spaces  
so this line starts a new line.
