A CommonMark-compliant, extensible Markdown parser written in Go with a focus on performance and a well-structured AST.
goldmark is a Markdown parser written in Go that fully implements the CommonMark specification. It provides a robust, extensible foundation for parsing and rendering Markdown documents, with built-in support for popular extensions like GitHub Flavored Markdown tables and task lists. It solves the problem of inconsistent Markdown dialects by adhering to a standard while remaining highly customizable.
Go developers who need a reliable, standards-compliant Markdown parser for applications like documentation generators, static site builders, or content management systems. It's particularly suited for projects requiring custom Markdown extensions or strict CommonMark compliance.
Developers choose goldmark for its combination of strict CommonMark compliance, excellent performance, and unparalleled extensibility. Unlike alternatives, it offers an interface-based AST for easy extension, a rich set of built-in extensions, and a design that balances speed with a clean, maintainable codebase.
:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Fully adheres to CommonMark 0.31.2, ensuring consistent rendering and compatibility with platforms like GitHub, as stated in the README.
Benchmarks show performance on par with cmark, the C-based reference implementation, and competitive with other Go parsers while consuming less memory.
Uses an interface-based AST and modular parsers, allowing developers to easily add custom syntax like @mentions or new block elements through documented extension points.
Ships with extensions for tables, strikethrough, task lists, footnotes, and typographer, reducing the need for external code for common GitHub Flavored Markdown features.
By default, it does not sanitize HTML or dangerous URLs; the README explicitly recommends using bluemonday for secure rendering of untrusted content, adding dependency management overhead.
Creating new AST nodes, parsers, and renderers involves implementing multiple interfaces and understanding the internal pipeline, which can be overwhelming for simple customizations.
The custom attribute syntax is noted as possibly changing in the future, as it's under discussion in the CommonMark forum, posing a maintenance risk for projects relying on it.