{"id":533,"library":"mistune","title":"Mistune Markdown Parser","description":"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.","status":"active","version":"3.2.0","language":"python","source_language":"en","source_url":"https://github.com/lepture/mistune","tags":["markdown","parser","html","renderer","plugins","fast"],"install":[{"cmd":"pip install mistune","lang":"bash","label":"Install latest stable version"}],"dependencies":[],"imports":[{"wrong":"import mistune","symbol":"Markdown","correct":"from mistune import Markdown"}],"quickstart":{"code":"import mistune\n\nmarkdown_text = \"\"\"\n# Hello, Mistune!\n\nThis is **bold** text and `code`.\n\n- Item 1\n- Item 2\n\"\"\"\n\nhtml_output = mistune.html(markdown_text)\nprint(html_output)","lang":"python","description":"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."},"warnings":[{"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`.","message":"Mistune 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.","severity":"breaking","affected_versions":">=3.0.0"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Initialize a Markdown instance once using `markdown = mistune.create_markdown(...)` and then call `markdown(text)` for subsequent conversions.","message":"While 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.","severity":"gotcha","affected_versions":"All v3 versions"},{"fix":"Upgrade to `mistune>=3.0.2` to resolve potential `RecursionError` issues with list parsing.","message":"Versions of Mistune v3 prior to 3.0.2 experienced a `RecursionError` when parsing complex lists.","severity":"gotcha","affected_versions":"<3.0.2"}],"env_vars":null,"search_vec":"'3.2.0':29 'activ':22 'bug':41 'current':26 'fast':9,47 'fix':40 'html':44 'maintain':23 'markdown':2,10,42 'mistun':1,4 'newer':36 'offer':14 'parser':3,11,43 'plugin':17,46 'python':13,37 'receiv':31 'regular':32 'render':19,45 'sane':7 'support':35 'updat':33 'use':16 'various':15 'version':27,38","created_at":"2026-03-28T15:17:43.267377+00:00","updated_at":"2026-04-16T16:33:40.270934+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"3.2.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/sponsors/lepture","docs":"https://mistune.lepture.com/","changelog":null,"pypi":"https://pypi.org/project/mistune/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":"verified"}}