commonmark-vs-gfm

このページは FormatArc のブログ記事が引用している実測の生データです。検索結果には表示されません (noindex)。

Files

FileSize
README.md2.5 KB
measure.mjs6.7 KB
package-lock.json54.7 KB
package.json537 B
results.json2.6 KB
sample.md118 B

README.md

# commonmark-vs-gfm renderer matrix

Reproducible feature-detection across six Markdown renderers, used in
`content/blog/{ja,en,es,pt}/commonmark-vs-gfm.md` for the "Which GFM extensions
are on by default?" matrix.

## What it measures

A single sample (`sample.md`) containing a pipe table, `~~strike~~`,
`~tilde~` (single-tilde), a task list `- [ ]`, a bare URL, and a footnote
reference `[^1]`, rendered through:

1. commonmark.js 0.31.2 (reference CommonMark implementation)
2. marked 18.0.5 (default settings)
3. markdown-it 14.2.0 (default preset)
4. remark 15.0.1 + remark-rehype (no GFM plugin)
5. remark 15.0.1 + remark-gfm 4.0.1 + remark-rehype
6. GitHub Markdown API (https://api.github.com/markdown, mode: "markdown")

Each renderer's HTML output is inspected with simple feature detectors
(`<table>`, `<del>`, `<s>`, `<input type="checkbox">`, linkified `<a>`,
footnote `<section>` / `<sup>`) and the result is printed as a matrix.

## How to reproduce

```bash
cd scripts/benchmarks/commonmark-vs-gfm
npm install
node measure.mjs
```

The GitHub Markdown API call is unauthenticated by default. If you hit
rate limits, set `GITHUB_TOKEN=<your token>` before running.

## Measured results (2026-06-23)

| Renderer | Table | `~~strike~~` | `~tilde~` (single) | `- [ ]` task | bare URL | `[^1]` footnote |
| --- | --- | --- | --- | --- | --- | --- |
| commonmark.js 0.31.2 | pipes as text | literal `~~` | literal `~` | literal `[ ]` | literal URL | link-ref fallback |
| marked 18.0.5 (default) | `<table>` | `<del>` | `<del>` | `<input type="checkbox">` | linkified | link-ref fallback |
| markdown-it 14.2.0 (default) | `<table>` | `<s>` | literal `~` | literal `[ ]` | literal URL | link-ref fallback |
| remark 15.0.1 (no plugins) | pipes as text | literal `~~` | literal `~` | literal `[ ]` | literal URL | link-ref fallback |
| remark 15.0.1 + remark-gfm 4.0.1 | `<table>` | `<del>` | `<del>` | `<input type="checkbox">` | linkified | rendered as footnote |
| GitHub Markdown API (markdown mode) | `<table>` | `<del>` | `<del>` | literal `[ ]` | linkified | rendered as footnote |

"link-ref fallback" means the footnote-definition syntax `[^1]: ...` is
re-interpreted as a link reference definition, so `text[^1]` resolves to
`<a href="footnote">^1</a>` (silent rewrite) instead of either a footnote
or a syntax error.

## History

- 2026-06-23 — Created. Reproduces the matrix that already appeared in the
  article (claimed "tested 2026-06-13" but had no reproduction script).
  Re-running the script confirms the article's claims byte-for-byte for
  this sample.

results.json

{
  "generatedAt": "2026-07-31T04:20:12.220Z",
  "environment": {
    "node": "v26.3.1",
    "platform": "darwin/arm64",
    "dependencies": {
      "commonmark": "0.31.2",
      "marked": "18.0.5",
      "markdown-it": "14.2.0",
      "remark": "15.0.1",
      "remark-gfm": "4.0.1",
      "remark-parse": "11.0.0",
      "remark-rehype": "11.1.2",
      "rehype-stringify": "10.0.1",
      "unified": "11.0.5"
    },
    "github": "GitHub Markdown API (POST https://api.github.com/markdown, mode=markdown)"
  },
  "sample": "| col | val |\n| --- | --- |\n| a | 1 |\n\n~~strike~~\n\n~tilde~\n\n- [ ] task\n\nhttps://example.com\n\ntext[^1]\n\n[^1]: footnote\n",
  "features": [
    "Table",
    "~~strike~~",
    "~tilde~ (single ~)",
    "- [ ] task",
    "bare URL",
    "[^1] footnote"
  ],
  "results": [
    {
      "renderer": "commonmark.js 0.31.2",
      "features": {
        "Table": "pipes as text",
        "~~strike~~": "literal ~~",
        "~tilde~ (single ~)": "literal ~",
        "- [ ] task": "literal [ ]",
        "bare URL": "literal URL",
        "[^1] footnote": "linkref"
      }
    },
    {
      "renderer": "marked 18.0.5 (default)",
      "features": {
        "Table": "<table>",
        "~~strike~~": "<del>",
        "~tilde~ (single ~)": "<del>",
        "- [ ] task": "<input checkbox>",
        "bare URL": "linkified",
        "[^1] footnote": "linkref"
      }
    },
    {
      "renderer": "markdown-it 14.2.0 (default)",
      "features": {
        "Table": "<table>",
        "~~strike~~": "<s>",
        "~tilde~ (single ~)": "literal ~",
        "- [ ] task": "literal [ ]",
        "bare URL": "literal URL",
        "[^1] footnote": "linkref"
      }
    },
    {
      "renderer": "remark 15.0.1 (no plugins)",
      "features": {
        "Table": "pipes as text",
        "~~strike~~": "literal ~~",
        "~tilde~ (single ~)": "literal ~",
        "- [ ] task": "literal [ ]",
        "bare URL": "literal URL",
        "[^1] footnote": "linkref"
      }
    },
    {
      "renderer": "remark 15.0.1 + remark-gfm 4.0.1",
      "features": {
        "Table": "<table>",
        "~~strike~~": "<del>",
        "~tilde~ (single ~)": "<del>",
        "- [ ] task": "<input checkbox>",
        "bare URL": "linkified",
        "[^1] footnote": "footnote"
      }
    },
    {
      "renderer": "GitHub Markdown API (markdown mode)",
      "features": {
        "Table": "<table>",
        "~~strike~~": "<del>",
        "~tilde~ (single ~)": "<del>",
        "- [ ] task": "literal [ ]",
        "bare URL": "linkified",
        "[^1] footnote": "footnote"
      }
    }
  ]
}