From 0acf1668c0cb5a206176975a7a2f7efddbfb163c Mon Sep 17 00:00:00 2001 From: Pagwin Date: Wed, 10 Dec 2025 15:22:08 -0500 Subject: [PATCH] ordered list prefix --- src/Markdown.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Markdown.hs b/src/Markdown.hs index 85bd3af..812394c 100644 --- a/src/Markdown.hs +++ b/src/Markdown.hs @@ -151,7 +151,8 @@ unorderedListBlock = listBlock Unordered unordered_prefix (\level -> unwrap <$> orderedListBlock :: (Logger m, Characters s) => Int -> Parser s m Element orderedListBlock = listBlock Ordered ordered_prefix (\level -> unwrap <$> ((try $ unorderedListBlock level) <|> orderedListBlock level)) where - ordered_prefix = error "ordered_prefix" + -- regex equivalent: [0-9]+[.)]\s? + ordered_prefix = (some digitChar) *> (char '.' <|> char ')') *> optional spaceChar -- not exhaustive but we know listBlock is returning a List unwrap (List l) = l