diff --git a/src/inline.rs b/src/inline.rs index 88f0279..39388ba 100644 --- a/src/inline.rs +++ b/src/inline.rs @@ -337,12 +337,14 @@ impl<'s> Parser<'s> { matches!(t.kind, lex::Kind::Open(Delimiter::Brace)) }) { - return self.ahead_attributes( - AttributesElementType::Container { - e_placeholder: event_opener - 1, - }, - false, - ); + return self + .ahead_attributes( + AttributesElementType::Container { + e_placeholder: event_opener - 1, + }, + false, + ) + .or(Some(Continue)); } } else { // continue verbatim @@ -788,6 +790,7 @@ impl<'s> Parser<'s> { }, false, ) + .or(Some(Continue)) } else { closed } @@ -1573,6 +1576,28 @@ mod test { ); } + #[test] + fn container_unclosed_attr() { + test_parse!( + "^.^{unclosed", + (Enter(Superscript), "^"), + (Str, "."), + (Exit(Superscript), "^"), + (Str, "{unclosed"), + ); + } + + #[test] + fn verbatim_unclosed_attr() { + test_parse!( + "`.`{unclosed", + (Enter(Verbatim), "`"), + (Str, "."), + (Exit(Verbatim), "`"), + (Str, "{unclosed"), + ); + } + #[test] fn container_unopened() { test_parse!("*}abc", (Str, "*}abc"));