From 65d4b46c2a3bdecb0493e484473d2de3d124f839 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 12 Sep 2022 17:43:19 +0200 Subject: Fix containers piercing into indented code --- tests/fuzz.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tests/fuzz.rs') diff --git a/tests/fuzz.rs b/tests/fuzz.rs index 126032a..146ff24 100644 --- a/tests/fuzz.rs +++ b/tests/fuzz.rs @@ -10,9 +10,9 @@ fn fuzz() -> Result<(), String> { "1: label, blank lines, and code" ); + // The first link is stopped by the `+` (so it’s `a@b.c`), but the next + // link overlaps it (`b.c+d@e.f`). assert_eq!( - // The first link is stopped by the `+` (so it’s `a@b.c`), but the next - // link overlaps it (`b.c+d@e.f`). micromark_with_options( "a@b.c+d@e.f", &Options { @@ -25,5 +25,17 @@ fn fuzz() -> Result<(), String> { "2: gfm: email autolink literals running into each other" ); + assert_eq!( + micromark(" x\n* "), + "
x\n
\n", + "3-a: containers should not pierce into indented code" + ); + + assert_eq!( + micromark(" a\n* b"), + "
a\n
\n", + "3-b: containers should not pierce into indented code" + ); + Ok(()) } -- cgit