From cdafacdee841676c637ed86efaa229dc9e5f525b Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 14 Jun 2022 05:16:09 +0000 Subject: fix(ast): list ast construction --- src/ast.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ast.rs b/src/ast.rs index 49ee1f6..eae0683 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -364,7 +364,11 @@ impl Ast { list_items.push(line.get(1..).unwrap_or("").trim_start().to_string()); - line = lines.next().unwrap(); + if let Some(next_line) = lines.next() { + line = next_line; + } else { + break; + } } ">" => { // If the Gemtext line starts with an ">", it is a blockquote, so -- cgit v1.2.3