from_html_to_md

Function from_html_to_md 

Source
pub fn from_html_to_md(input: String) -> String
👎Deprecated since 0.7.0: This function is deprecated and will be removed in future versions. Please use the safe_parse_html function instead.
Expand description

Converts a string of HTML to a markdown string.

Panics if the HTML is invalid.

§Arguments

  • input - A string of HTML to be converted to markdown.

§Examples

use html2md_rs::to_md::from_html_to_md;

let input = "<h1>Hello world</h1>".to_string();
let parsed = from_html_to_md(input);

assert_eq!(parsed, "# Hello world\n");