From 9c2b0b1a66028e1c8ab92868ec6e1128d467e32d Mon Sep 17 00:00:00 2001 From: xfy Date: Tue, 23 Jun 2026 09:58:53 +0800 Subject: [PATCH] test(markdown): remove diagnostic marker, keep slash verification test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除 data-pipeline-v2 诊断标记(已完成使命:确认新二进制含新代码)。 保留 full_pipeline_wrap_then_clean_preserves_slash 测试,它验证完整 渲染管线(wrap → clean_html)的斜杠格式不被 sanitizer 破坏。 根因记录: 文章正文 HTML 存在 posts.content_html 字段,创建/更新时 渲染一次存入 DB,展示时直接读 DB 不重新渲染。blur-up 的 markdown 改动只对新渲染生效,存量文章需重新保存或 rebuild_content_html 触发重渲染。 --- src/api/markdown.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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");