A fast, extensible CommonMark/Markdown parser for Java with source-level AST and emulation of other markdown processors.
flexmark-java is a Java-based Markdown parser that implements the CommonMark specification and provides a detailed abstract syntax tree (AST) with source-level position tracking. It solves the need for a fast, extensible Markdown processor in Java applications, especially where performance and accurate emulation of other Markdown flavors are critical.
Java developers building applications that require Markdown processing, such as documentation tools, IDE plugins, content management systems, or conversion pipelines.
Developers choose flexmark-java for its combination of speed, extensibility, and accurate emulation of other Markdown processors, along with a rich set of built-in extensions and detailed AST capabilities not found in simpler parsers.
CommonMark/Markdown Java parser with source level AST. CommonMark 0.28, emulation of: pegdown, kramdown, markdown.pl, MultiMarkdown. With HTML to MD, MD to PDF, MD to DOCX conversion modules.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a detailed abstract syntax tree with character-level position tracking, essential for IDE plugins like Markdown Navigator that need exact source mapping for features such as refactoring or error highlighting.
Designed for easy customization with a modular architecture; the README highlights that adding extensions often requires only a few lines of code, supported by samples and an adapter for pegdown migration.
Built for speed even with many extensions installed, handling pathological inputs efficiently—benchmarks show it parses 100,000 nested brackets in 55ms, drastically outperforming pegdown which hangs on similar inputs.
Comes with numerous built-in extensions for tables, GitLab Flavored Markdown, PDF/DOCX conversion, and more, reducing the need for custom implementations in common use cases.
The project openly admits to evolving APIs with breaking changes, such as in version 0.60.0, which can disrupt existing integrations and require significant maintenance effort for upgrading teams.
With its granular options and many extensions, initial setup can be overwhelming for simple tasks; the README warns that improper use of the API can lead to 'uphill battles' and buggy implementations.
Based on CommonMark spec 0.28, which is not the latest version, limiting compatibility with newer Markdown features unless custom extensions are written, potentially causing gaps in standard compliance.
flexmark-java is an open-source alternative to the following products: