aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-12-19 09:58:52 +0400
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-12-19 09:58:52 +0400
commitaf202d3f0ea24e0a957b02a6f9fb23c6c3b4afe7 (patch)
tree2b17565298b591fab613c53924b47ec66b870b81 /src
parenta8f5da1524761c5f55deca36c34ff8aee061bf32 (diff)
downloadmarkdown-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--src/to_mdast.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/to_mdast.rs b/src/to_mdast.rs
index 4d2ca76..e76bad5 100644
--- a/src/to_mdast.rs
+++ b/src/to_mdast.rs
@@ -1430,7 +1430,9 @@ fn on_exit_list_item_value(context: &mut CompileContext) {
if let Node::List(node) = context.tail_penultimate_mut() {
debug_assert!(node.ordered, "expected list to be ordered");
- node.start = Some(start);
+ if node.start.is_none() {
+ node.start = Some(start);
+ }
} else {
unreachable!("expected list on stack");
}