foo()"));
}
#[test]
fn strict_code_block() {
let r = Renderer::strict();
let html = r.render("```\nlet x = 1;\n```");
assert!(html.contains(""));
assert!(html.contains("let x = 1;"));
}
#[test]
fn strict_blockquote() {
let r = Renderer::strict();
let html = r.render("> quoted text");
assert!(html.contains(""));
assert!(html.contains("quoted text"));
}
#[test]
fn strict_unordered_list() {
let r = Renderer::strict();
let html = r.render("- item one\n- item two");
assert!(html.contains(""));
assert!(html.contains("- item one
"));
}
#[test]
fn strict_heading() {
let r = Renderer::strict();
let html = r.render("## Section Title");
assert!(html.contains("Section Title
"));
}
#[test]
fn strict_plain_text() {
let r = Renderer::strict();
assert_eq!(r.render("hello world"), "hello world
\n");
}
#[test]
fn strict_empty_input() {
assert_eq!(Renderer::strict().render(""), "");
}
// ===== Sanitize-only preset =====
#[test]
fn sanitize_only_cleans_html() {
let r = Renderer::sanitize_only();
let html = r.sanitize_html("Hello
");
assert!(html.contains("Hello
"));
assert!(!html.contains("