Registry / serialization / mistune

mistune

JSON →
library3.3.4pypypi✓ verified 25d ago

Mistune is a sane and fast Markdown parser for Python, offering various useful plugins and renderers. It is actively maintained, with the current version being 3.2.0, and receives regular updates to support newer Python versions and fix bugs.

pip install mistune
INSTALL
IMPORT
SIG · MISTUNE
M
mistune
serializationpythonv3.3.4
Install
1.7s avg
Import
98ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.3.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.102s · 18.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.094s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Markdown
from mistune import Markdown
import mistune

This quickstart demonstrates the simplest way to convert Markdown text to HTML using the `mistune.html()` function, which provides a default setup with many common features enabled.

import mistune markdown_text = """ # Hello, Mistune! This is **bold** text and `code`. - Item 1 - Item 2 """ html_output = mistune.html(markdown_text) print(html_output)
Debug
Known issues
breakingMistune v3 introduced significant breaking changes compared to v2, particularly in custom renderer methods' parameters and the redesign of directives. Migrating existing code, especially custom plugins or renderers, will require updates.
fix
Refer to the official 'Upgrade Guide' for detailed changes. Parameter signatures for custom renderer methods and directive handling have been altered. For instance, `RstDirective` was renamed to `RSTDirective`.
affects: >=3.0.0
gotchaThe default behavior for HTML escaping differs between `mistune.html()` and `mistune.create_markdown()`. `mistune.html()` does not escape raw HTML tags by default, while `mistune.create_markdown()` (without `escape=False`) *does* escape HTML.
fix
If using `create_markdown()`, explicitly set `escape=False` in its parameters if you want raw HTML to be rendered directly: `mistune.create_markdown(escape=False)`. Always be mindful of potential XSS vulnerabilities when disabling HTML escaping for untrusted input.
affects: >=3.0.0
gotchaWhile a global `mistune.markdown()` function exists, for performance-critical applications or when using custom configurations and plugins, it is recommended to create and reuse a `Markdown` instance (e.g., via `mistune.create_markdown()`) rather than calling the global function repeatedly.
fix
Initialize a Markdown instance once using `markdown = mistune.create_markdown(...)` and then call `markdown(text)` for subsequent conversions.
affects: All v3 versions
gotchaVersions of Mistune v3 prior to 3.0.2 experienced a `RecursionError` when parsing complex lists.
fix
Upgrade to `mistune>=3.0.2` to resolve potential `RecursionError` issues with list parsing.
affects: <3.0.2
Upgrade
Version history
3.3.4latest on PyPI · released Jul 22, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
8
Anthropic
1
Resources