
Parses CommonMark into a document tree and renders HTML, Markdown or plain text with opt-in extensions, custom parser/renderer support, and an HTML DSL/DOM adapter.
Kotlin Multiplatform library for parsing CommonMark into a document tree and rendering it as HTML, Markdown, or plain text. Based on commonmark-java, with opt-in extensions and support for custom parsers and renderers.
Supports JVM (Java 17+), Android 7.0+ (API 24+), JavaScript, WebAssembly, and Kotlin/Native.
The optional kotlinx.html renderer inserts Markdown into HTML DSL/DOM consumers with explicitly selected extension adapters.
Add the dependency to your module (or commonMain.dependencies in a Multiplatform project):
implementation("io.heapy.kotmark:kotmark:0.1.0")import io.heapy.kotmark.parser.parser
import io.heapy.kotmark.renderer.html.htmlRenderer
val document = parser().parse("Hello, **Kotlin**!")
val html = htmlRenderer().render(document)
// <p>Hello, <strong>Kotlin</strong>!</p>CommonMark 0.31.2, checked against the complete 655-example specification suite and the 652-example corpus bundled with commonmark-java. Extensions add tables, strikethrough, task lists, footnotes, math, and more. Support for selected GFM features does not imply full GFM conformance.
User guide · Extensions · Guides · API reference · Contributing
Original Kotmark code and modifications: Apache License 2.0. Third-party licenses and notices: UPSTREAM.md.
Kotlin Multiplatform library for parsing CommonMark into a document tree and rendering it as HTML, Markdown, or plain text. Based on commonmark-java, with opt-in extensions and support for custom parsers and renderers.
Supports JVM (Java 17+), Android 7.0+ (API 24+), JavaScript, WebAssembly, and Kotlin/Native.
The optional kotlinx.html renderer inserts Markdown into HTML DSL/DOM consumers with explicitly selected extension adapters.
Add the dependency to your module (or commonMain.dependencies in a Multiplatform project):
implementation("io.heapy.kotmark:kotmark:0.1.0")import io.heapy.kotmark.parser.parser
import io.heapy.kotmark.renderer.html.htmlRenderer
val document = parser().parse("Hello, **Kotlin**!")
val html = htmlRenderer().render(document)
// <p>Hello, <strong>Kotlin</strong>!</p>CommonMark 0.31.2, checked against the complete 655-example specification suite and the 652-example corpus bundled with commonmark-java. Extensions add tables, strikethrough, task lists, footnotes, math, and more. Support for selected GFM features does not imply full GFM conformance.
User guide · Extensions · Guides · API reference · Contributing
Original Kotmark code and modifications: Apache License 2.0. Third-party licenses and notices: UPSTREAM.md.