Markdown API Reference¶
markdown
¶
Markdown to HTML renderer — zero dependencies, stdlib only, Python 3.10+.
Part of zerodep: https://github.com/Oaklight/zerodep Copyright (c) 2026 Peng Ding. MIT License.
Drop-in replacement for mistune's mistune.html() for common Markdown.
Supports
- ATX and Setext headings
- Paragraphs, thematic breaks, hard line breaks
- Emphasis (bold, italic, bold-italic)
- Inline code and fenced/indented code blocks
- Links (inline, reference, autolink) and images
- Ordered and unordered lists with nesting
- Block quotes with nesting
- GFM tables with column alignment
- GFM strikethrough (~~text~~)
- GFM task lists (- [ ] / - [x])
- GFM extended autolinks (bare URLs)
- Backslash escapes
Does NOT implement
- Raw HTML passthrough (escaped for safety)
- Footnotes, definition lists, math/LaTeX
Example::
from markdown import render
render("# Hello\n\nThis is **bold**.")
# '<h1>Hello</h1>\n<p>This is <strong>bold</strong>.</p>\n'
render(text)
¶
Convert Markdown text to HTML.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Markdown source string. |
required |
Returns:
| Type | Description |
|---|---|
str
|
HTML string. |