本页还没有译文
本页 23 段还没译成日本語,下面显示的是英文原文。Overview
还没翻译译自英文(tanstack.com)本页 23 段都还没译
TanStack Markdown
TanStack Markdown is a small, synchronous Markdown parser and renderer built for technical blogs and documentation.
It provides independently importable paths for each layer:
- A parser that produces a deterministic, serializable AST
- An HTML renderer with safe defaults
- React and Octane renderers with the same core output semantics
- An optional profile for accumulated AI response streams
The package has no runtime dependencies. React and Octane are optional peer dependencies used only by their matching adapter entry points, and syntax highlighting stays outside the Markdown bundle.
Why another Markdown library?
General Markdown processors optimize for broad conformance, plugin ecosystems, or content transformation pipelines. Those are valid goals, but a controlled docs site often needs much less:
- familiar prose, links, images, tables, lists, footnotes, and code fences
- deterministic server and client rendering
- explicit handling of raw HTML and executable URLs
- code metadata for documentation UI
- a small browser bundle
TanStack Markdown spends its complexity budget on that path. It deliberately does not implement every CommonMark edge case, MDX evaluation, automatic linkification, or a general asynchronous processing ecosystem.
Core properties
Small entry points
Current minified browser bundles are 5.2 KB gzip for the parser, 7.0 KB for HTML rendering, and 7.0 KB for either UI adapter with its framework runtime externalized. The generated bundle report is the source of truth.
Parse once, render many
parseMarkdown returns plain objects and arrays. The result can be serialized, cached, inspected, transformed, and passed to either renderer.
Safe defaults
Raw HTML is escaped unless allowHtml is enabled. Executable URL protocols such as javascript: are removed from links and images.
Focused compatibility
The supported contract is the TanStack docs syntax profile, not full CommonMark or GFM. Compatibility is continuously measured so established behavior cannot regress silently.
AI streaming without parser state
The optional AI streaming profile reparses accumulated response text and suppresses incomplete trailing block placeholders. It adds 0.2 KB gzip to the React path while leaving the core parser and renderers unchanged.
Choose your starting point
- Continue to Installation for package and runtime requirements.
- Use Quick Start for HTML, React, and Octane examples.
- Read Comparison to evaluate the tradeoffs.
- Review the Syntax Profile before migrating an existing content corpus.