Skip to main content

readabilityrs/elements/
mod.rs

1pub mod code_blocks;
2pub mod footnotes;
3pub mod headings;
4pub mod images;
5pub mod languages;
6pub mod math;
7
8/// Run the full standardization pipeline on HTML content.
9///
10/// This normalizes vendor-specific HTML (code blocks, headings, images,
11/// footnotes, math) into canonical forms before markdown conversion.
12pub fn standardize_all(html: &str, title: Option<&str>) -> String {
13    let mut result = html.to_string();
14
15    result = code_blocks::standardize_code_blocks(&result);
16    result = headings::standardize_headings(&result, title);
17    result = images::standardize_images(&result);
18    result = footnotes::standardize_footnotes(&result);
19    result = math::standardize_math(&result);
20
21    result
22}