From 8b41cfabde848b24fdae65d09ad961c2412e023b Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 25 Oct 2022 18:59:31 +0200 Subject: Fix type of `start` on list in mdast Closes GH-17. Co-authored-by: Christian Murphy --- src/mdast.rs | 2 +- tests/fuzz.rs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mdast.rs b/src/mdast.rs index 559ff62..f0ca902 100644 --- a/src/mdast.rs +++ b/src/mdast.rs @@ -558,7 +558,7 @@ pub struct List { pub ordered: bool, /// Starting number of the list. /// `None` when unordered. - pub start: Option, + pub start: Option, /// One or more of its children are separated with a blank line from its /// siblings (when `true`), or not (when `false`). pub spread: bool, diff --git a/tests/fuzz.rs b/tests/fuzz.rs index a4a6765..bb63035 100644 --- a/tests/fuzz.rs +++ b/tests/fuzz.rs @@ -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] @@ -39,13 +39,21 @@ fn fuzz() -> Result<(), String> { assert_eq!( to_html("_ "), "

_

", - "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())?, "

a ~

", - "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(()) -- cgit