Core Concepts

Syntax Profile

Syntax Profile

TanStack Markdown implements a documented subset aimed at repository-authored blogs, guides, API documentation, changelogs, and release notes.

Block syntax

SyntaxSupportNotes
ATX headingsYesLevels 1-6 with stable duplicate-safe IDs
ParagraphsYesSoft line breaks remain text line breaks
Fenced code blocksYesBacktick and tilde fences, language and docs metadata
BlockquotesYesNested parsing with a bounded depth
Unordered listsYesTight, loose, nested, and task items
Ordered listsYes. and ) markers, custom starts, tight and loose items
TablesYesHeader delimiter and left/center/right alignment
Thematic breaksYesHyphen, asterisk, and underscore forms
Frontmatter extractionYesLeading --- block, enabled by default
FootnotesYesDefinition order follows first reference
Raw HTMLOpt-inParsed and emitted only with allowHtml: true
Setext headingsNoUse # headings
Indented code blocksNoUse fenced code blocks

Inline syntax

SyntaxSupportNotes
Emphasis and strongYesNatural prose patterns; not every pathological delimiter case
StrikethroughYesGFM ~~text~~ and legacy TanStack ~text~
Inline codeYesBacktick spans
Inline links and imagesYesUnsafe URL protocols are removed
Reference links and imagesYesFull and collapsed forms used by the maintained corpus
Hard breaksYesBackslash before a newline
Raw inline HTMLOpt-inRequires allowHtml: true
Autolink literalsNoWrite an explicit link
Entity decodingPartialHTML is escaped; full CommonMark entity behavior is not a goal

Docs metadata

Code fences understand metadata used by technical documentation:

markdown
```tsx file="app.tsx" framework="react" {2,4-6}
export function App() {
  return <main>Hello</main>
}
```

The AST records lang, meta, title, file, framework, and highlightLines. Rendering the metadata does not add a syntax highlighter.

Optional docs syntax

The docs extension entry points add:

  • GitHub-style callouts such as > [!TIP]
  • heading collection for table-of-contents data
  • comment-delimited component blocks
  • file, package-manager, bundler, and framework transforms

See the Docs Preset guide.

Deliberate limits

The following are not project goals:

  • complete CommonMark or GFM conformance
  • MDX, JSX parsing, or arbitrary code evaluation
  • automatic URL linking
  • a complete HTML parser or sanitizer
  • every delimiter, indentation, entity, or reference-label interaction
  • syntax highlighting, themes, or language grammars
  • asynchronous plugin pipelines

Unsupported input must still be deterministic, escaped by default, and bounded in runtime. New syntax requires evidence from real documentation, regression fixtures, renderer parity, and an accepted bundle cost.