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))
|
matches!(t.kind, lex::Kind::Open(Delimiter::Brace))
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
return self.ahead_attributes(
|
return self
|
||||||
|
.ahead_attributes(
|
||||||
AttributesElementType::Container {
|
AttributesElementType::Container {
|
||||||
e_placeholder: event_opener - 1,
|
e_placeholder: event_opener - 1,
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
);
|
)
|
||||||
|
.or(Some(Continue));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// continue verbatim
|
// continue verbatim
|
||||||
|
@ -788,6 +790,7 @@ impl<'s> Parser<'s> {
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
.or(Some(Continue))
|
||||||
} else {
|
} else {
|
||||||
closed
|
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]
|
#[test]
|
||||||
fn container_unopened() {
|
fn container_unopened() {
|
||||||
test_parse!("*}abc", (Str, "*}abc"));
|
test_parse!("*}abc", (Str, "*}abc"));
|
||||||
|
|
Loading…
Reference in a new issue