From f2216119aea4ff59bac0f4215db0a8fc3a0eac49 Mon Sep 17 00:00:00 2001 From: xfy Date: Thu, 23 Jul 2026 16:30:31 +0800 Subject: [PATCH] =?UTF-8?q?chore(markdown):=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=B8=AD=E7=9A=84=E9=95=BF=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E5=AD=97=E9=9D=A2=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/markdown.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/api/markdown.rs b/src/api/markdown.rs index 12bbee9..9f7b7d6 100644 --- a/src/api/markdown.rs +++ b/src/api/markdown.rs @@ -738,7 +738,8 @@ mod tests { #[test] fn wrap_tables_wraps_bare_table() { - let html = "
A
1
"; + let html = + "
A
1
"; let result = wrap_tables(html); assert!( result.starts_with("
") @@ -763,7 +764,8 @@ mod tests { #[test] fn wrap_tables_wraps_multiple_tables() { - let html = "
1
\n

间隔

\n
2
"; + let html = + "
1
\n

间隔

\n
2
"; let result = wrap_tables(html); let wrap_count = result.matches("
").count(); assert_eq!(wrap_count, 2, "两个 table 应各自包裹, got: {}", result); @@ -794,7 +796,8 @@ mod tests { #[test] fn wrap_tables_then_clean_preserves_div_and_table() { // 端到端:wrap → clean_html,确认 sanitizer 放行 div.table-wrap 与内部 table 结构。 - let html = "
H
v
"; + let html = + "
H
v
"; let wrapped = wrap_tables(html); let cleaned = clean_html(&wrapped); assert!(