fix(validate): allow empty ListItem (#11)
This commit is contained in:
parent
8fb6e90f57
commit
923343a076
|
@ -188,11 +188,13 @@ impl Org<'_> {
|
||||||
| Element::Italic
|
| Element::Italic
|
||||||
| Element::Underline
|
| Element::Underline
|
||||||
| Element::Strike
|
| Element::Strike
|
||||||
| Element::DynBlock(_)
|
| Element::DynBlock(_) => {
|
||||||
| Element::ListItem(_) => {
|
|
||||||
expect_children!(node_id);
|
expect_children!(node_id);
|
||||||
}
|
}
|
||||||
Element::Drawer(_) | Element::TableCell(_) | Element::Table(_) => (),
|
Element::ListItem(_)
|
||||||
|
| Element::Drawer(_)
|
||||||
|
| Element::TableCell(_)
|
||||||
|
| Element::Table(_) => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errors
|
errors
|
||||||
|
|
21
tests/issue_11.rs
Normal file
21
tests/issue_11.rs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
use orgize::Org;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn can_handle_empty_list_item() {
|
||||||
|
let cases = &[
|
||||||
|
"0. ",
|
||||||
|
"* \n0. ",
|
||||||
|
" * ",
|
||||||
|
" 0. ",
|
||||||
|
"\t* ",
|
||||||
|
"- ",
|
||||||
|
"- hello\n- ",
|
||||||
|
"- \n- hello",
|
||||||
|
"- hello\n- \n- world",
|
||||||
|
"* world\n- ",
|
||||||
|
];
|
||||||
|
|
||||||
|
for case in cases {
|
||||||
|
let _ = Org::parse(case);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue