inline: fix unclosed attrs after cont/verb
This commit is contained in:
parent
9d9aded764
commit
45c86da274
1 changed files with 31 additions and 6 deletions
|
@ -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"));
|
||||
|
|
Loading…
Reference in a new issue