Yuhao's Blog
Alpine landscape

Markdown Syntax Test

#markdown#test#astro
Contents

Welcome to the Markdown syntax test page. This post covers common Markdown, GFM (GitHub Flavored Markdown), math formulas and Mermaid diagrams to exercise the rendering pipeline.

Headings

H3 heading

Body text under an H3. Every H2/H3/H4 heading has an anchor — hover the left edge of the heading to reveal the # link icon.

H4 heading

H4 is for finer sections. Bold, italic, bold italic and strikethrough mix freely here.

Paragraphs & line breaks

This is a paragraph. Paragraphs are separated by blank lines and never merge automatically.

This is a second paragraph. Two trailing spaces at the end of a line force a soft line break
so the text continues on the next line.

Inline styles

  • Bold: **bold**
  • Italic: *italic*
  • Bold italic: ***bold italic***
  • Strikethrough: ~~strikethrough~~ (GFM)
  • Inline code: const x = 1
  • Superscript/subscript: x2, H2O

Images

Example image

Images carry alt and title, and are neither selectable nor draggable.

Lists

Unordered

  • Item one
  • Item two
    • Nested A
    • Nested B
  • Item three

Ordered

  1. First
  2. Second
  3. Third
    1. Nested a
    2. Nested b

Task list (GFM)

  • Completed task
  • Open task
  • Task with code

Blockquotes

This is a blockquote.

Nested blockquote.

A blockquote can include bold and inline code.

Code

Inline code: npm run dev.

Fenced block (JavaScript):

function greet(name) {
  return `Hello, ${name}!`;
}

TypeScript:

interface User {
  id: number;
  name: string;
}
const user: User = { id: 1, name: "Alice" };

Python:

def fib(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a

Shell:

# install dependencies
pnpm install

Tables

AlignmentLeftCenterRight
Exampletexttexttext
Value100200300

Horizontal rule

Content above, split by a rule below:


Content after the rule.

Math

Inline: Euler’s identity eiπ+1=0e^{i\pi} + 1 = 0.

Display:

ex2dx=π\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}

Mermaid diagrams

Flowchart

flowchart LR
  A[Start] --> B{Ready?}
  B -- Yes --> C[Run task]
  B -- No --> D[Wait]
  C --> E[End]

Sequence

sequenceDiagram
  participant User
  participant Server
  User->>Server: Send request
  activate Server
  Server-->>User: Return result
  deactivate Server

Raw HTML & full-bleed image

Wrapped in raw HTML, this one bleeds to the paper edge:

Paper-edge bleed example
Flush to the paper edge

Emoji & special characters

😄 🚀 ✨ — plus characters that need escaping: &, <, >, ".

Closing

That covers most common syntax. If anything renders wrong, please report it.