diff --git a/src/block.rs b/src/block.rs index 8c310ea..3f9f87a 100644 --- a/src/block.rs +++ b/src/block.rs @@ -429,6 +429,24 @@ mod test { (Element(Inline), " l1"), (Exit(Leaf(CodeBlock { fence_length: 4 })), "````"), ); + test_parse!( + concat!( + "```\n", // + "a\n", // + "```\n", // + "```\n", // + "bbb\n", // + "```\n", // + ), + (Enter(Leaf(CodeBlock { fence_length: 3 })), "```"), + (Element(Inline), ""), + (Element(Inline), "a\n"), + (Exit(Leaf(CodeBlock { fence_length: 3 })), "```"), + (Enter(Leaf(CodeBlock { fence_length: 3 })), "```"), + (Element(Inline), ""), + (Element(Inline), "bbb\n"), + (Exit(Leaf(CodeBlock { fence_length: 3 })), "```"), + ); } macro_rules! test_block { diff --git a/src/lib.rs b/src/lib.rs index 8e18a24..177fc59 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -341,7 +341,6 @@ impl<'s> Iterator for Parser<'s> { tree::EventKind::Element(atom) => { assert_eq!(atom, block::Atom::Inline); parser.parse(ev.span.of(self.src)); - self.inline_start = ev.span.start(); } tree::EventKind::Exit(block) => { self.parser = None;