Skip to main content

render_plaintext()

Finish parsing (if needed) and render as readable plain text.

Usage

Source

render_plaintext(
    *,
    width=0,
)

Uses the formatting rules of markdown_to_plaintext, including retained list markers and omitted raw HTML.

Parameters

width: int = 0
Approximate wrapping column (0 = no automatic wrapping). Ignored when this parser was created with hardbreaks=True.

Returns

str
The rendered text, including a trailing newline.

Raises

ValueError
If the parser is closed.