From e1f045567569a91bd4864eb58758edfa2e6c8a89 Mon Sep 17 00:00:00 2001 From: lanyue-llk <270302213+lanyue-llk@users.noreply.github.com> Date: Thu, 22 Oct 2026 15:15:51 +0800 Subject: [PATCH] test(fetch): enforce exact CLI output at the owning layer --- moli-html2md/README.md | 5 +++-- moli-html2md/tests/turndown/README.md | 4 ++-- moli/tests/fetch_cli/markdown.rs | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/moli-html2md/README.md b/moli-html2md/README.md index 08a8921651..6f6eae2b11 100644 --- a/moli-html2md/README.md +++ b/moli-html2md/README.md @@ -72,8 +72,9 @@ Tables with `role="presentation"` or `role="none"` retain ordinary block expansi in DOM order with blank lines between cells, even when structurally simple. Role matching ignores ASCII case and surrounding HTML whitespace. Nested layout wrappers expand into readable blocks. Tables with header cells, captions, explicit -data roles, header relationships or real cell spans retain data-table structure. -Complex data tables use content-only HTML: non-unit spans, multiple `thead` rows, rows wider than +data roles, header relationships or real cell spans retain their authored structure. +These tables use content-only HTML for non-unit spans, multiple `thead` rows, +rows wider than an explicit header, or cells containing nested tables, lists, headings, quotes or preformatted blocks. This retains header, cell and nested-table associations that Markdown pipe tables cannot express. Inner simple tables can still produce diff --git a/moli-html2md/tests/turndown/README.md b/moli-html2md/tests/turndown/README.md index b59019b48e..a967b1df97 100644 --- a/moli-html2md/tests/turndown/README.md +++ b/moli-html2md/tests/turndown/README.md @@ -33,8 +33,8 @@ case is skipped. A reference change that makes a difference obsolete also fails the test. Separate converter tests cover GFM tables and strikethrough as Moli extensions. Explicit table headers follow Turndown's GFM plugin; simple headerless tables receive empty headings. Complex tables retain content-only HTML so merged -cells and nested tables keep their associations. Explicitly presentational tables -still expand into blocks. +cells and nested tables keep their associations. Presentational and layout-only containing +tables expand into blocks; their simple inner tables can use GFM. ## Findings tracked outside the reference corpus diff --git a/moli/tests/fetch_cli/markdown.rs b/moli/tests/fetch_cli/markdown.rs index a975c9bba5..a73ae67a4c 100644 --- a/moli/tests/fetch_cli/markdown.rs +++ b/moli/tests/fetch_cli/markdown.rs @@ -33,7 +33,7 @@ fn assert_markdown_dump(html: &str, markdown: &str, args: &[&str]) -> Result<()> ); assert_eq!( String::from_utf8(output.stdout)?, - format!("{}\n", markdown.trim_end_matches('\n')) + markdown.trim_end_matches('\n') ); Ok(()) }