Skip to content

Commit

Permalink
Fix type of start on list in mdast
Browse files Browse the repository at this point in the history
Closes GH-17.

Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
  • Loading branch information
wooorm and ChristianMurphy committed Oct 25, 2022
1 parent cd782d3 commit 8b41cfa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/mdast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ pub struct List {
pub ordered: bool,
/// Starting number of the list.
/// `None` when unordered.
pub start: Option<u8>,
pub start: Option<u32>,
/// One or more of its children are separated with a blank line from its
/// siblings (when `true`), or not (when `false`).
pub spread: bool,
Expand Down
14 changes: 11 additions & 3 deletions tests/fuzz.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate markdown;
use markdown::{to_html, to_html_with_options, Options};
use markdown::{mdast, to_html, to_html_with_options, to_mdast, Options};
use pretty_assertions::assert_eq;

#[test]
Expand Down Expand Up @@ -39,13 +39,21 @@ fn fuzz() -> Result<(), String> {
assert_eq!(
to_html("_ "),
"<p>_</p>",
"4-b: trailing whitespace and broken data"
"4-b: trailing whitespace and broken data (GH-13)"
);

assert_eq!(
to_html_with_options("a ~ ", &Options::gfm())?,
"<p>a ~</p>",
"4-c: trailing whitespace and broken data"
"4-c: trailing whitespace and broken data (GH-14)"
);

assert!(
matches!(
to_mdast("123456789. ok", &Default::default()),
Ok(mdast::Node::Root(_))
),
"5: lists should support high start numbers (GH-17)"
);

Ok(())
Expand Down

0 comments on commit 8b41cfa

Please sign in to comment.