From 72eed1cfa1f5067a7ca581c53bb40e9e0fb047cc Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 2 Oct 2025 13:21:37 +0200 Subject: fix(markdown): bad list parsing --- mardown/ast_list.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mardown/ast_list.go') diff --git a/mardown/ast_list.go b/mardown/ast_list.go index 8eb451a..f95324b 100644 --- a/mardown/ast_list.go +++ b/mardown/ast_list.go @@ -42,7 +42,7 @@ func list(lxs *lexers) (block, error) { for lxs.Next() && n < 2 { switch lxs.Current().Type { case lexerBreak: - n++ + n += len(lxs.Current().Value) case lexerList: n = 0 tp := detectListType(lxs.Current().Value) @@ -56,9 +56,11 @@ func list(lxs *lexers) (block, error) { if err != nil { return nil, err } + lxs.Before() // because we must parse the last char tree.content = append(tree.content, c) } } + lxs.Before() // because we did not use it return tree, nil } -- cgit v1.2.3