goldmark parses CommonMark markdown into ASTs with optional extensions and HTML or custom renderers. Version 2 emphasizes semantic ASTs and programmatic document building.
Overview
goldmark is a Go markdown processor aimed at CommonMark compliance with extension points for custom syntax and renderers. It builds abstract syntax trees that applications can analyze or transform.
The project ships HTML rendering by default and supports additional output formats through separated parser and renderer stages. Extensions cover tables, task lists, and other CommonMark-adjacent features used in documentation pipelines.
Version 2 revises the AST for semantic analysis, uses generics, tracks source positions on nodes, and allows constructing markdown programmatically before rendering. A WASM playground demonstrates in-browser parsing.
Authors note growing uses in language servers, AI document tooling, and generators that need faithful markdown structure rather than HTML-only conversion.
Key features
- CommonMark compliance
- Extensible parser hooks
- AST with source positions
- HTML and custom renderers
- Programmatic AST building
- Optional extensions
- WASM playground
Use cases
- Docs site rendering
- Markdown static analysis
- LSP-style tooling
- AI document pipelines