markdown.from_html

markdown

from_html(html) -> markdown

Extract a markdown-friendly rendering from raw HTML

Picks the article root from messy real-world HTML, strips noise tags, converts structural tags to markdown, and decodes entities. Output is intended for a markdown renderer or pager — see markdown.from_html submodule for decode_entities if needed separately.