aboutsummaryrefslogtreecommitdiff
path: root/mardown/ast_list.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 13:21:37 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 13:21:37 +0200
commit72eed1cfa1f5067a7ca581c53bb40e9e0fb047cc (patch)
tree5a4e8b69c4e2705222baf1e1c8e0ffcfadfb3c98 /mardown/ast_list.go
parentcdb0a541554aa4a16fc71b6425225e8c603c83b8 (diff)
fix(markdown): bad list parsing
Diffstat (limited to 'mardown/ast_list.go')
-rw-r--r--mardown/ast_list.go4
1 files changed, 3 insertions, 1 deletions
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
}