Skip to content

Commit

Permalink
html: fix missing <p> tags after ordered lists
Browse files Browse the repository at this point in the history
resolves #44
  • Loading branch information
hellux committed Aug 5, 2023
1 parent fa2a1ac commit 185a481
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,13 @@ impl<'s> Writer<'s> {
}
match c {
Container::Blockquote => out.write_str("</blockquote>")?,
Container::List {
kind: ListKind::Unordered | ListKind::Task,
..
} => {
Container::List { kind, .. } => {
self.list_tightness.pop();
out.write_str("</ul>")?;
match kind {
ListKind::Unordered | ListKind::Task => out.write_str("</ul>")?,
ListKind::Ordered { .. } => out.write_str("</ol>")?,
}
}
Container::List {
kind: ListKind::Ordered { .. },
..
} => out.write_str("</ol>")?,
Container::ListItem | Container::TaskListItem { .. } => {
out.write_str("</li>")?;
}
Expand Down
12 changes: 12 additions & 0 deletions tests/html-ut/ut/lists.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```
1. item

para
.
<ol>
<li>
item
</li>
</ol>
<p>para</p>
```

0 comments on commit 185a481

Please sign in to comment.