From ad8eac98c1468b30c17c339e79b84c37a7b15517 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 13 Jul 2022 10:40:11 +0200 Subject: Fix to close containers before several (blank) line endings --- tests/block_quote.rs | 11 +++++------ tests/code_fenced.rs | 22 ++++++++++------------ tests/list.rs | 48 ++++++++++++++++++++++-------------------------- 3 files changed, 37 insertions(+), 44 deletions(-) (limited to 'tests') diff --git a/tests/block_quote.rs b/tests/block_quote.rs index 8fb4e61..782104f 100644 --- a/tests/block_quote.rs +++ b/tests/block_quote.rs @@ -143,12 +143,11 @@ fn block_quote() { "should support interrupting block quotes w/ blank lines" ); - // To do: some container bug introduces due to lists? - // assert_eq!( - // micromark("> a\n>\nb"), - // "
\n

a

\n
\n

b

", - // "should not support interrupting a blank line in a block quotes w/ paragraphs" - // ); + assert_eq!( + micromark("> a\n>\nb"), + "
\n

a

\n
\n

b

", + "should not support interrupting a blank line in a block quotes w/ paragraphs" + ); assert_eq!( micromark("> > > a\nb"), diff --git a/tests/code_fenced.rs b/tests/code_fenced.rs index b7bfd79..fa9ed5f 100644 --- a/tests/code_fenced.rs +++ b/tests/code_fenced.rs @@ -57,12 +57,11 @@ fn code_fenced() { "should support an eof somewhere in content" ); - // To do: container exits before (blank) line endings. - // assert_eq!( - // micromark("> ```\n> aaa\n\nbbb"), - // "
\n
aaa\n
\n
\n

bbb

", - // "should support no closing sequence in a block quote" - // ); + assert_eq!( + micromark("> ```\n> aaa\n\nbbb"), + "
\n
aaa\n
\n
\n

bbb

", + "should support no closing sequence in a block quote" + ); assert_eq!( micromark("```\n\n \n```"), @@ -227,12 +226,11 @@ fn code_fenced() { "should not support a closing sequence w/ too much indent, regardless of opening sequence (1)" ); - // To do: container exits before (blank) line endings. - // assert_eq!( - // micromark("> ```\n>\n>\n>\n\na"), - // "
\n
\n\n\n
\n
\n

a

", - // "should not support a closing sequence w/ too much indent, regardless of opening sequence (2)" - // ); + assert_eq!( + micromark("> ```\n>\n>\n>\n\na"), + "
\n
\n\n\n
\n
\n

a

", + "should not support a closing sequence w/ too much indent, regardless of opening sequence (2)" + ); assert_eq!( micromark("> ```a\nb"), diff --git a/tests/list.rs b/tests/list.rs index e45c31d..1eee72a 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -383,19 +383,17 @@ fn list() { // "should support blank lines between items (2)" // ); - // To do: list (for some weird reason seen as one list?). - // assert_eq!( - // micromark_with_options("- foo\n- bar\n\n\n\n- baz\n- bim", DANGER), - // "\n\n", - // "should support HTML comments between lists" - // ); + assert_eq!( + micromark_with_options("- foo\n- bar\n\n\n\n- baz\n- bim", DANGER), + "\n\n", + "should support HTML comments between lists" + ); - // To do: list (for some weird reason the HTML is in the list?). - // assert_eq!( - // micromark_with_options("- foo\n\n notcode\n\n- foo\n\n\n\n code", DANGER), - // "\n\n
code\n
", - // "should support HTML comments between lists and indented code" - // ); + assert_eq!( + micromark_with_options("- foo\n\n notcode\n\n- foo\n\n\n\n code", DANGER), + "\n\n
code\n
", + "should support HTML comments between lists and indented code" + ); // To do: list (indent). // assert_eq!( @@ -529,14 +527,13 @@ fn list() { // "should support blank lines in code after an initial blank line" // ); - // To do: list (blank lines). - // assert_eq!( - // micromark( - // "* a tight item that ends with an html element: `x`\n\nParagraph" - // ), - // "\n

Paragraph

", - // "should ignore line endings after tight items ending in tags" - // ); + assert_eq!( + micromark( + "* a tight item that ends with an html element: `x`\n\nParagraph" + ), + "\n

Paragraph

", + "should ignore line endings after tight items ending in tags" + ); // To do: list (empty). // assert_eq!( @@ -608,12 +605,11 @@ fn list() { // "should support complex nested and empty lists (3)" // ); - // To do: list (blank lines in lists?). - // assert_eq!( - // micromark_with_options("* a\n\n\n\n* b", DANGER), - // "\n\n", - // "should support the common list breaking comment method" - // ); + assert_eq!( + micromark_with_options("* a\n\n\n\n* b", DANGER), + "\n\n", + "should support the common list breaking comment method" + ); // To do: turning things off. // assert_eq!( -- cgit