Skip to main content

html_to_markdown

Function html_to_markdown 

Source
pub fn html_to_markdown(html: &str) -> String
Expand description

Convert an HTML document to markdown: headings, links, list items, emphasis, code and block structure survive; <script>/<style>/ comments and every other tag are dropped, entities are decoded.

A small tag-walking converter, not a DOM: the model needs the readable text and its structure, and a fetched page’s markup is never trusted input for anything but text.