inline: fix unclosed attrs after cont/verb

This commit is contained in:
Noah Hellman 2023-05-01 21:04:08 +02:00
parent 9d9aded764
commit 45c86da274

View file

@ -337,12 +337,14 @@ impl<'s> Parser<'s> {
matches!(t.kind, lex::Kind::Open(Delimiter::Brace))
})
{
return self.ahead_attributes(
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"));