From c4ea17692f4fac8df304993d2271704e79344968 Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Fri, 11 Jul 2025 20:38:07 -0700 Subject: Fix extra whitespace in markdown rendering. (#3943) Co-authored-by: Scott Densmore --- .../__snapshots__/MarkdownDisplay.test.tsx.snap | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 packages/cli/src/ui/utils/__snapshots__/MarkdownDisplay.test.tsx.snap (limited to 'packages/cli/src/ui/utils/__snapshots__/MarkdownDisplay.test.tsx.snap') diff --git a/packages/cli/src/ui/utils/__snapshots__/MarkdownDisplay.test.tsx.snap b/packages/cli/src/ui/utils/__snapshots__/MarkdownDisplay.test.tsx.snap new file mode 100644 index 00000000..66436bbd --- /dev/null +++ b/packages/cli/src/ui/utils/__snapshots__/MarkdownDisplay.test.tsx.snap @@ -0,0 +1,89 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[` > correctly parses a mix of markdown elements 1`] = ` +"Main Title + +Here is a paragraph. + + - List item 1 + - List item 2 + + 1 some code + +Another paragraph. +" +`; + +exports[` > handles a table at the end of the input 1`] = ` +"Some text before. +| A | B | +|---| +| 1 | 2 |" +`; + +exports[` > handles unclosed (pending) code blocks 1`] = `" 1 let y = 2;"`; + +exports[` > inserts a single space between paragraphs 1`] = ` +"Paragraph 1. + +Paragraph 2." +`; + +exports[` > renders a fenced code block with a language 1`] = ` +" 1 const x = 1; + 2 console.log(x);" +`; + +exports[` > renders a fenced code block without a language 1`] = `" 1 plain text"`; + +exports[` > renders a simple paragraph 1`] = `"Hello, world."`; + +exports[` > renders headers with correct levels 1`] = ` +"Header 1 +Header 2 +Header 3 +Header 4 +" +`; + +exports[` > renders horizontal rules 1`] = ` +"Hello +--- +World +--- +Test +" +`; + +exports[` > renders nested unordered lists 1`] = ` +" * Level 1 + * Level 2 + * Level 3 +" +`; + +exports[` > renders nothing for empty text 1`] = `""`; + +exports[` > renders ordered lists 1`] = ` +" 1. First item + 2. Second item +" +`; + +exports[` > renders tables correctly 1`] = ` +" +┌──────────┬──────────┐ +│ Header 1 │ Header 2 │ +├──────────┼──────────┤ +│ Cell 1 │ Cell 2 │ +│ Cell 3 │ Cell 4 │ +└──────────┴──────────┘ +" +`; + +exports[` > renders unordered lists with different markers 1`] = ` +" - item A + * item B + + item C +" +`; -- cgit v1.2.3