diff --git a/src/api/markdown.rs b/src/api/markdown.rs index 9aeddce..3c534e4 100644 --- a/src/api/markdown.rs +++ b/src/api/markdown.rs @@ -375,6 +375,18 @@ mod tests { assert!(result.contains(" / "), "aspect-ratio must use slash separator, got: {}", result); } + #[test] + fn full_pipeline_wrap_then_clean_preserves_slash() { + // 模拟完整渲染管线:wrap_images_with_blur → clean_html + // 验证 sanitizer 不把斜杠转义或删掉 + let html = r#"t"#; + let wrapped = wrap_images_with_blur(html); + let cleaned = clean_html(&wrapped); + println!("WRAPPED: {}", wrapped); + println!("CLEANED: {}", cleaned); + assert!(cleaned.contains(" / "), "clean_html must preserve slash in --ar, got: {}", cleaned); + } + #[test] fn slugify_heading_simple() { assert_eq!(slugify_heading("Hello World"), "hello-world");