Marko (Python Markdown Parser)

2.2.2 · active · verified Thu Apr 09

Marko is a pure Python markdown parser, version 2.2.2, designed for high extensibility and strict adherence to CommonMark's spec v0.31.2. It supports Python 3.9 and higher, with its latest release on January 5, 2026. The library offers a flexible extension system for custom features, although its strict compliance can result in slower performance compared to some other parsers.

Warnings

Install

Imports

Quickstart

A basic example demonstrating how to convert Markdown text to HTML using `marko.convert()`. It also includes a brief example of initializing the `Markdown` class with a built-in extension.

import marko

markdown_text = """
# Hello Marko!

This is **bold** text and *italic* text.

- Item 1
- Item 2

```python
print('Hello from a code block')
```
"""

html_output = marko.convert(markdown_text)
print(html_output)

# Example with an extension
from marko import Markdown
markdown = Markdown(extensions=['footnote'])
html_with_footnote = markdown.convert('Footnotes[^1]\n\n[^1]: My footnote.')
print(html_with_footnote)

view raw JSON →