Crate html2md_rs

source ·
Expand description

A library for safely parsing HTML and converting it to Markdown.

§Example

use html2md_rs::to_md::from_html_to_md;

let html = "<h1>Hello World</h1>".to_string();
let parsed = from_html_to_md(html);

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

§Supported HTML Elements

The list of supported HTML elements is in the structs::NodeType enum.

§HTML Attributes

By default, the library parses all attributes of an HTML element as a HashMap.

§Markdown Convention

This library follows the CommonMark Spec.

§License

This library is licensed under the MIT license. Check the GitHub repository for more information.

Modules§

  • This module contains functions which parsees HTML string into a custom Node struct.
  • This module contains functions that converts a Node to a markdown string.