krik 0.1.27

A fast static site generator written in Rust with internationalization, theming, and modern web features
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use krik::generator::markdown::{generate_toc_and_content, markdown_to_html};

#[test]
fn markdown_to_html_basic() {
    let (html, _toc) = markdown_to_html("# Hello\n\nThis is **bold**.", false, None);
    assert!(html.contains("<h1"));
    assert!(html.contains("<strong>"));
}

#[test]
fn toc_generation_excludes_title() {
    let content = "<h1>Title</h1>\n<h2>Section 1</h2>\n<h3>Subsection</h3>";
    let (toc, processed) = generate_toc_and_content(content, Some("Title"));
    assert!(toc.contains("Section 1"));
    assert!(toc.contains("Subsection"));
    assert!(!toc.contains("Title"));
    assert_eq!(processed, content);
}