Skip to content

Instantly share code, notes, and snippets.

@Robbie-Cook
Created March 9, 2026 04:39
Show Gist options
  • Select an option

  • Save Robbie-Cook/d4425dcda1e0c10a721c05b7f885eee0 to your computer and use it in GitHub Desktop.

Select an option

Save Robbie-Cook/d4425dcda1e0c10a721c05b7f885eee0 to your computer and use it in GitHub Desktop.

The Ultimate Markdown Stress Test

This document exercises every common (and uncommon) Markdown feature. Use it to verify that your importer handles real-world content gracefully.


Table of Contents

  1. Headings
  2. Text Formatting
  3. Links & Images
  4. Lists
  5. Blockquotes
  6. Code
  7. Tables
  8. Horizontal Rules
  9. Special Characters & HTML Entities
  10. Extended Syntax
  11. Edge Cases
  12. Long-Form Content

Headings

Heading Level 1

Heading Level 2

Heading Level 3

Heading Level 4

Heading Level 5
Heading Level 6

Alternate heading styles:

Heading Level 1 (Alt)

Heading Level 2 (Alt)


Text Formatting

This is a plain paragraph. It contains multiple sentences to simulate realistic content. Markdown importers should preserve whitespace and line breaks correctly across paragraph boundaries.

This is a second paragraph, separated by a blank line. It exists to verify that paragraph breaks render as expected rather than collapsing into a single block.

Here is a very short paragraph.

This entire sentence is bold. And this entire sentence is italic. You can also use underscores for bold and underscores for italic.

Combining them: bold and italic together or also bold and italic. You can nest them too: bold with italic inside and italic with bold inside.

This text is struck through. And here is strikethrough with bold inside.

Here is a combination of everything: bold italic strikethrough -- if your parser handles that, congratulations.

Superscript and subscript (HTML fallback): H2O is water. E = mc2 is famous.

Highlighted text using the HTML <mark> tag.


Links & Images

Inline Links

Visit Canva for design tools. Here is a link with a title: Google.

Reference-Style Links

Read more at Wikipedia or check the Markdown Guide.

Autolinks and Bare URLs

Autolink style: https://example.com

Bare URL (some parsers auto-link these): https://example.com/path?query=value&foo=bar#anchor

Email link: user@example.com

Images

A placeholder image (300x200)

Landscape placeholder

Reference-style image:

Alt text for reference image

Image Inside a Link

Clickable image


Lists

Unordered Lists

  • Apple
  • Banana
  • Cherry
    • Dark cherry
    • Maraschino cherry
      • Extra sweet
      • Extra tart
    • Rainier cherry
  • Dragonfruit

Using asterisks:

  • Item one
  • Item two
  • Item three

Using plus signs:

  • Alpha
  • Beta
  • Gamma

Ordered Lists

  1. First step: gather requirements
  2. Second step: write code
  3. Third step: test thoroughly
    1. Unit tests
    2. Integration tests
      1. API integration
      2. Database integration
      3. Third-party service integration
    3. End-to-end tests
  4. Fourth step: deploy

Starting from a different number:

  1. This list starts at five
  2. Then six
  3. Then seven

Mixed Nested Lists

  1. Prepare the environment
    • Install Node.js
    • Install Python 3.10+
    • Configure your editor
  2. Clone the repository
    • Via HTTPS: git clone https://github.com/example/repo.git
    • Via SSH: git clone git@github.com:example/repo.git
      1. Make sure your SSH key is configured
      2. Test with ssh -T git@github.com
  3. Run the project
    • Development: npm run dev
    • Production: npm run build && npm start

Task Lists (Checkboxes)

  • Set up project structure
  • Implement core parser
  • Add support for tables
  • Add support for footnotes
  • Write unit tests
  • Write documentation
    • README
    • API reference
    • Contributing guide

Blockquotes

This is a simple blockquote. It contains a single paragraph of quoted text.

This is a multi-paragraph blockquote.

The second paragraph is still part of the same quote. Blockquotes can contain bold, italic, and inline code.

Nested Blockquotes

Dorothy followed her through many of the beautiful rooms in her castle.

The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.

"I will do as you say," Dorothy replied, "but only because I must."

Blockquote with Other Elements

Quarterly Results

Revenue was off the chart:

  • Q1: $1.2M
  • Q2: $1.8M
  • Q3: $2.4M

Things are going well.

total_revenue = sum(quarterly_results)

Code

Inline Code

Use console.log() to print values. The <div> element is a block container. Backtick inside code: `backtick`.

Fenced Code Blocks

JavaScript

function fibonacci(n) {
  if (n <= 1) return n;
  const memo = [0, 1];
  for (let i = 2; i <= n; i++) {
    memo[i] = memo[i - 1] + memo[i - 2];
  }
  return memo[n];
}

// Usage
console.log(fibonacci(10)); // 55

Python

from typing import Generator

def fibonacci(n: int) -> Generator[int, None, None]:
    """Generate the first n Fibonacci numbers."""
    a, b = 0, 1
    for _ in range(n):
        yield a
        a, b = b, a + b

# Usage
for num in fibonacci(10):
    print(num, end=" ")
# Output: 0 1 1 2 3 5 8 13 21 34

Bash

#!/usr/bin/env bash
set -euo pipefail

# Deploy script
echo "Starting deployment..."
git pull origin main
npm ci --production
pm2 restart all
echo "Deployment complete!"

JSON

{
  "name": "markdown-importer",
  "version": "2.0.0",
  "dependencies": {
    "unified": "^11.0.0",
    "remark-parse": "^11.0.0",
    "remark-gfm": "^4.0.0"
  },
  "scripts": {
    "test": "vitest run",
    "build": "tsc && vite build"
  }
}

HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Test Page</title>
</head>
<body>
  <h1>Hello, Markdown!</h1>
  <p>This is an <em>HTML</em> code block inside a Markdown file.</p>
</body>
</html>

CSS

:root {
  --primary: #2563eb;
  --surface: #f8fafc;
}

.markdown-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: #1e293b;
  max-width: 80ch;
  margin: 0 auto;
  padding: 2rem;
}

.markdown-body h1 {
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.3em;
}

Plain Code Block (No Language)

This is a plain code block with no language hint.
It should still be rendered as monospaced preformatted text.
    Indentation is preserved.
        Even deeper indentation.

Indented Code Block (4 spaces)

This is an indented code block.
Some parsers treat 4-space-indented text as code.
No syntax highlighting expected here.

Tables

Simple Table

Name Role Location
Alice Engineer Sydney
Bob Designer Melbourne
Charlie Product Manager Auckland

Table with Alignment

Left Aligned Center Aligned Right Aligned
Row 1 Data $100
Row 2 More data $1,500
Row 3 Even more $23,000

Table with Inline Formatting

Feature Status Notes
Parser βœ… Complete Handles all CommonMark features
Renderer 🚧 WIP Missing table support
Legacy API ❌ Removed Deprecated in v1.5.0
newEngine() πŸš€ Shipped See docs

Wide Table (Horizontal Scroll Test)

Column A Column B Column C Column D Column E Column F Column G Column H Column I Column J
Data 1A Data 1B Data 1C Data 1D Data 1E Data 1F Data 1G Data 1H Data 1I Data 1J
Data 2A Data 2B Data 2C Data 2D Data 2E Data 2F Data 2G Data 2H Data 2I Data 2J

Horizontal Rules

Three different syntaxes:




All three should produce identical horizontal lines.


Special Characters & HTML Entities

HTML Entities

  • Ampersand: &
  • Less than: <
  • Greater than: >
  • Non-breaking space: Β  (between these words)
  • Copyright: Β© 2025
  • En dash: –
  • Em dash: β€”
  • Curly quotes: β€œHello” and β€˜Hi’

Raw HTML

Click to expand this collapsible section

This content is hidden by default. It demonstrates that raw HTML works inside Markdown.

  • List inside details
  • Another item
print("Code inside a collapsible section!")
This div is center-aligned using raw HTML.

Emoji Shortcodes

Here are some common emoji shortcodes (GitHub-flavored Markdown):

  • πŸš€ Launch
  • πŸŽ‰ Celebration
  • ⚠️ Warning
  • πŸ› Bug report
  • πŸ“ Documentation
  • ✨ New feature
  • πŸ”₯ Hot fix
  • βœ… Done
  • 🚧 Work in progress
  • ❌ Removed
  • πŸ‘ Approved
  • ❀️ Love it

Extended Syntax

Footnotes

Here is a sentence with a footnote1. And here is another one2.

Definition Lists

Markdown : A lightweight markup language for creating formatted text using a plain-text editor.

CommonMark : A strongly-defined, highly compatible specification of Markdown, created to resolve ambiguities in the original spec.

GFM (GitHub Flavored Markdown) : A superset of CommonMark with extensions like tables, task lists, strikethrough, and autolinks.

Math / LaTeX

Inline math: The equation $E = mc^2$ changed physics forever. The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.

Block math:

$$ \sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n $$

$$ \int_{0}^{\infty} e^{-x^2} , dx = \frac{\sqrt{\pi}}{2} $$

$$ \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix} $$

Abbreviations

*[HTML]: Hyper Text Markup Language *[CSS]: Cascading Style Sheets *[GFM]: GitHub Flavored Markdown

The HTML and CSS specs are maintained by the W3C. GFM is maintained by GitHub.


Escaping

These characters are normally special in Markdown but are escaped here:

* not bold *

# not a heading

[ not a link ]

> not a blockquote

- not a list item

| not a table cell |

` not inline code `

\ a literal backslash

_ not italic _

~ not strikethrough ~


Edge Cases

Empty Heading

(The heading above is empty -- just ### with nothing after it.)

Empty List Items

  • Item with content
  • Another item with content

Deeply Nested Structure

  • Level 1
    • Level 2
      • Level 3
        • Level 4
          • Level 5
            • Level 6
              • Level 7 -- how deep can your parser go?

Very Long Line

This is a single paragraph with an intentionally very long line that does not contain any line breaks. The purpose of this line is to test how the renderer handles horizontal overflow, word wrapping, and scrolling behavior. In many editors and preview tools, a line this long will either wrap naturally at the container boundary, or it will cause a horizontal scrollbar to appear. Either way, this tests an important edge case. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Special Unicode Characters

Category Characters
Arrows <-- --> <-> => ==>
Currency $ EUR JPY GBP
Math symbols +- x / != <= >= ~ approx
Accented cafe resume naive
CJK Hanzi Hiragana Katakana
Emoji (literal) Hello World Fire Stars
Zero-width chars A​B (zero-width space between A and B)
Right-to-left Merhaba Dunya

Consecutive Blockquotes

First quote.

Second quote -- should these merge or stay separate?

Paragraph Immediately After a List

  • List item one
  • List item two This text comes right after the list without a blank line. Some parsers treat it as part of the last list item; others treat it as a new paragraph.

Link-Like Text That Isn't a Link

The file path [not a real link] and the bracket text [another fake] should not become clickable if there is no URL.

But this one is real.


Long-Form Content

The History of Markup Languages

The story of markup languages begins long before the web. In the 1960s, IBM developed GML (Generalized Markup Language) to manage large volumes of documentation for their mainframes. This system allowed technical writers to annotate documents with structural metadata -- headings, paragraphs, lists -- without worrying about presentation. The key insight was separating content from formatting, an idea that would echo through decades of computing history.

GML evolved into SGML (Standard Generalized Markup Language), ratified as an ISO standard in 1986. SGML was powerful but complex. It could describe virtually any document structure, but its flexibility came at a cost: the specification ran to hundreds of pages, and building a conforming parser was a formidable engineering challenge.

Tim Berners-Lee, working at CERN in the late 1980s, needed something simpler. His goal was to link documents across the nascent internet so that physicists could share research. He created HTML (HyperText Markup Language) as an application of SGML -- a small, fixed vocabulary of tags designed for a specific purpose. HTML was intentionally limited. You could create headings, paragraphs, lists, and links. That was about it. And that simplicity was its greatest strength.

The web exploded in the 1990s. HTML grew rapidly, accreting new elements with each browser war. Tables, frames, font tags, blink tags -- the language became a chaotic mix of structure and presentation. The W3C responded with CSS to handle presentation and XHTML to impose stricter syntax rules. But for many authors, writing raw HTML felt like programming when all they wanted to do was write.

Enter Markdown. In 2004, John Gruber, with contributions from Aaron Swartz, released a lightweight markup syntax that could be converted to HTML. The philosophy was radical in its simplicity: Markdown should be readable as plain text. A paragraph is just a paragraph. A heading is a line prefixed with #. A list is lines prefixed with -. No angle brackets, no closing tags, no attributes.

Markdown spread quickly through the developer community. GitHub adopted it for README files and comments. Stack Overflow used it for questions and answers. Blogging platforms, documentation tools, and note-taking apps all embraced it. Its popularity revealed a latent demand: people wanted to write structured content without the overhead of a markup language designed for machines.

But Markdown's simplicity also created problems. Gruber's original specification was deliberately informal, leaving many edge cases undefined. What happens when you nest a blockquote inside a list inside another blockquote? Different parsers gave different answers. The CommonMark project, launched in 2014, aimed to resolve these ambiguities with a rigorous specification and a comprehensive test suite.

Today, Markdown exists in many flavors: CommonMark, GitHub Flavored Markdown (GFM), MultiMarkdown, Pandoc Markdown, and more. Each adds its own extensions -- tables, footnotes, task lists, math notation -- while trying to preserve the core promise of readability.

The journey from GML to Markdown spans half a century of computing, but the core insight remains the same: the best tools for writing are the ones that get out of the way and let the author focus on what they want to say.

Why Stress-Testing Matters

If you are building a Markdown importer, you already know that the happy path is easy. A heading, a paragraph, some bold text -- any parser can handle that. The hard part is the edges: the deeply nested list that breaks your recursive renderer, the table with a pipe character inside inline code, the footnote that references another footnote, the blockquote that contains a code block that contains a table.

This file exists to push your parser to its limits. Every section above was designed to probe a specific behavior. If your importer can render this entire document correctly -- headings, lists, code blocks, tables, footnotes, math, emoji, HTML entities, edge cases, and all -- then it can handle virtually anything a user will throw at it.

Good luck, and happy parsing.


Generated as a comprehensive Markdown test fixture. Last updated: 2025.

Footnotes

  1. This is the first footnote. Short and sweet. ↩

  2. This is a longer footnote with multiple paragraphs.

    The second paragraph of the footnote is indented to show it belongs to the same note.

    You can even include code: let x = 42; ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment