diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-09-26 16:25:40 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-09-26 16:25:40 +0200 |
| commit | abafb39041d47f1fe4281c60cb4e3e40db2181d1 (patch) | |
| tree | 65b321218510857671175d0388162317783c6030 /src | |
| parent | 704f2fbaf1b4483caa12f249a222c49e44f08961 (diff) | |
Fix bad list interaction
Fixes #87
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/content.rs | 5 | ||||
| -rw-r--r-- | src/parse/parser.rs | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/model/content.rs b/src/model/content.rs index ae074b50..7828a3cd 100644 --- a/src/model/content.rs +++ b/src/model/content.rs @@ -413,6 +413,11 @@ impl<'a> Builder<'a> { self.interrupt(Interruption::List, styles, false)?; + if let Content::Item(_) = content { + self.list.accept(content, styles); + return Ok(()); + } + if self.par.accept(content, styles) { return Ok(()); } diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 90b6e610..f8ea9614 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -454,8 +454,8 @@ impl Marker { /// Wrap all children after the marker (excluding trailing trivia) in a node /// with the given `kind`. pub fn end(self, p: &mut Parser, kind: NodeKind) { - let until = p.trivia_start(); - let children = p.children.drain(self.0 .. until.0).collect(); + let until = p.trivia_start().0.max(self.0); + let children = p.children.drain(self.0 .. until).collect(); p.children .insert(self.0, InnerNode::with_children(kind, children).into()); } |
