micromark-extension-gfm-strikethrough

micromark tokenizer extension for GFM strikethrough syntax

Library
npm
v2.1.0
3stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
26/100Needs Attention
Development Activity0
Maintenance32
Community12
Maturity60
Momentum0

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
68/100Good
Architecture70
Code Quality90
Innovation55
Learning Curve55

micromark-extension-gfm-strikethrough is a low-level tokenizer extension for the micromark markdown parser that teaches it to recognize GitHub Flavored Markdown strikethrough syntax (~~text~~). It operates at the character-tokenization layer, below the syntax-tree layer, and includes both a parsing extension (gfmStrikethrough()) and an optional HTML-compiling extension (gfmStrikethroughHtml()) for direct markdown-to-HTML use.

It is one of the smallest building blocks in the unified/remark/micromark ecosystem, maintained under the micromark GitHub organization by Titus Wormer. Most consumers reach it transitively through micromark-extension-gfm (full GFM) or remark-gfm/mdast-util-gfm-strikethrough for syntax-tree use cases, rather than depending on it directly.

What You Get

  • gfmStrikethrough(options?) — a micromark syntax extension that tokenizes ~~text~~ per the GFM spec
  • gfmStrikethroughHtml() — an optional HTML-compiler extension that renders strikethrough directly to <del> tags
  • A singleTilde option controlling whether single-tilde strikethrough (~text~) is also recognized
  • Full TypeScript type definitions and 100%-coverage-enforced test suite
  • Zero-dependency-on-mdast design — usable with plain micromark when no syntax tree is needed

Common Use Cases

  • Rendering markdown directly to HTML via micromark + this extension, without building a syntax tree, for lightweight markdown-to-HTML conversion
  • Composing custom micromark-based markdown parsers/renderers that need GFM strikethrough support
  • Used transitively by micromark-extension-gfm and, via mdast-util-gfm-strikethrough, by remark-gfm for full GitHub Flavored Markdown support

Under The Hood

Architecture The package is a micromark tokenizer extension: it defines character codes and finite-state tokenizer functions that micromark’s core parser calls into when it encounters a tilde (~) character, following the same extension-object protocol (text, resolveAll) used by every other micromark-extension-* package. A companion HTML-compiler extension separately hooks the enter/exit events for the produced tokens to emit <del>/</del>. Tech Stack Pure JavaScript authored with JSDoc types (compiled via tsc --build + type-coverage to a .d.ts), depending only on other micromark-util-* helper packages (chunked, classify-character, resolve-all, symbol, types) and devlop for dev-mode assertions — no unrelated runtime dependencies. Code Quality The test/ directory runs against micromark itself in both development and production conditions (test-api-dev/test-api-prod), with c8 --100 enforcing full coverage as part of the required test script, and fixtures partly generated via create-gfm-fixtures to track the upstream GFM spec. API Design The public surface is two small factory-free extension objects designed to be spread into micromark’s extensions/htmlExtensions arrays, keeping the same minimal-composition convention as the rest of the ecosystem; the singleTilde option is the only configuration surface, kept deliberately narrow to match the GFM spec’s own ambiguity around single-tilde strikethrough.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search