diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-12-19 09:58:52 +0400 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-12-19 09:58:52 +0400 |
commit | af202d3f0ea24e0a957b02a6f9fb23c6c3b4afe7 (patch) | |
tree | 2b17565298b591fab613c53924b47ec66b870b81 /tests | |
parent | a8f5da1524761c5f55deca36c34ff8aee061bf32 (diff) | |
download | markdown-rs-af202d3f0ea24e0a957b02a6f9fb23c6c3b4afe7.tar.gz markdown-rs-af202d3f0ea24e0a957b02a6f9fb23c6c3b4afe7.tar.bz2 markdown-rs-af202d3f0ea24e0a957b02a6f9fb23c6c3b4afe7.zip |
Fix `start` on ordered lists in mdast
Closes GH-38.
Diffstat (limited to '')
-rw-r--r-- | tests/list.rs | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/tests/list.rs b/tests/list.rs index e8c42e8..0c2992e 100644 --- a/tests/list.rs +++ b/tests/list.rs @@ -616,27 +616,41 @@ fn list() -> Result<(), String> { ); assert_eq!( - to_mdast("3. a", &Default::default())?, + to_mdast("3. a\n4. b", &Default::default())?, Node::Root(Root { children: vec![Node::List(List { ordered: true, spread: false, start: Some(3), - children: vec![Node::ListItem(ListItem { - checked: None, - spread: false, - children: vec![Node::Paragraph(Paragraph { - children: vec![Node::Text(Text { - value: "a".into(), + children: vec![ + Node::ListItem(ListItem { + checked: None, + spread: false, + children: vec![Node::Paragraph(Paragraph { + children: vec![Node::Text(Text { + value: "a".into(), + position: Some(Position::new(1, 4, 3, 1, 5, 4)) + }),], position: Some(Position::new(1, 4, 3, 1, 5, 4)) - }),], - position: Some(Position::new(1, 4, 3, 1, 5, 4)) - })], - position: Some(Position::new(1, 1, 0, 1, 5, 4)) - })], - position: Some(Position::new(1, 1, 0, 1, 5, 4)) + })], + position: Some(Position::new(1, 1, 0, 1, 5, 4)) + }), + Node::ListItem(ListItem { + checked: None, + spread: false, + children: vec![Node::Paragraph(Paragraph { + children: vec![Node::Text(Text { + value: "b".into(), + position: Some(Position::new(2, 4, 8, 2, 5, 9)) + }),], + position: Some(Position::new(2, 4, 8, 2, 5, 9)) + })], + position: Some(Position::new(2, 1, 5, 2, 5, 9)) + }) + ], + position: Some(Position::new(1, 1, 0, 2, 5, 9)) })], - position: Some(Position::new(1, 1, 0, 1, 5, 4)) + position: Some(Position::new(1, 1, 0, 2, 5, 9)) }), "should support `start` fields on `List` w/ `ordered: true` in mdast" ); |