mdast-util-gfm-strikethrough
mdast extensions to parse and serialize GFM strikethrough syntax
Repository Health
Technical Analysis
mdast-util-gfm-strikethrough is a small syntax-tree extension package in the unified/remark ecosystem that adds GitHub Flavored Markdown strikethrough support (~~text~~) to mdast syntax trees. It exports two extensions: one that plugs into mdast-util-from-markdown to parse strikethrough into a delete node, and one that plugs into mdast-util-to-markdown to serialize that node back into markdown.
It is a low-level building block rather than something most application authors install directly — most consumers get strikethrough support transitively through mdast-util-gfm (all of GFM) or remark-gfm, both of which depend on this package. It is maintained under the syntax-tree organization by Titus Wormer alongside the rest of the unified ecosystem.
What You Get
gfmStrikethroughFromMarkdown()— an extension formdast-util-from-markdownthat turns~~text~~into adeletemdast nodegfmStrikethroughToMarkdown()— an extension formdast-util-to-markdownthat serializesdeletenodes back to~~text~~- Full TypeScript types via
@types/mdastand a generatedindex.d.ts - 100% test coverage enforced via
c8in CI-style build scripts - ESM-only distribution with zero runtime side effects (
sideEffects: false)
Common Use Cases
- Building a custom remark/mdast-based markdown processor that needs GFM strikethrough without pulling in all of GFM
- Used transitively by
mdast-util-gfmandremark-gfmto provide strikethrough support in most remark-based tooling - Authoring a markdown-to-markdown or markdown-to-HTML transform pipeline with
unifiedthat needs strikethrough round-tripping
Under The Hood
Architecture The package is intentionally minimal — lib/ contains the from-markdown and to-markdown extension objects, and index.js re-exports them. It has no parsing logic of its own for the strikethrough token itself; that lives in the companion micromark-extension-gfm-strikethrough package, which this package must be paired with when working with mdast-util-from-markdown directly. Tech Stack Pure JavaScript/TypeScript (types-only, via JSDoc + tsc --build) with dependencies limited to @types/mdast, mdast-util-from-markdown, and mdast-util-to-markdown — no unrelated dependencies. Tooling includes xo for linting, prettier for formatting, and remark-preset-wooorm for consistent docs across the syntax-tree org’s packages. Code Quality test.js (216 lines) exercises both extensions directly against mdast-util-from-markdown/to-markdown, run in both production and development conditions (test-api-prod/test-api-dev) with c8 --100 enforcing full coverage before every publish. API Design The API is deliberately tiny: two factory-free extension objects designed to be spread directly into the extensions/mdastExtensions arrays of the from-markdown/to-markdown APIs, following the same extension-object convention used across every other mdast-util-gfm-* package, which keeps composition predictable for anyone already using the unified ecosystem.
Used by 2 apps in this directory
AFFiNE
Productivity · Project Management · Note Taking
Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.
KeystoneJS
CMS · Developer Tools
The superpowered headless CMS for developers built with GraphQL and React