diff --git a/Text/MMark/Parser.hs b/Text/MMark/Parser.hs index fd03e6b..11412e9 100644 --- a/Text/MMark/Parser.hs +++ b/Text/MMark/Parser.hs @@ -404,6 +404,7 @@ pUnorderedList = do xs <- many $ do bulletPos <- try $ do p <- getPosition + guard (sourceColumn p >= sourceColumn startBulletPos) void (char bullet) eof <|> sc1 return p @@ -432,6 +433,7 @@ pOrderedList = do pos <- getPosition (actual, alevel', indexPos) <- try $ do p <- getPosition + guard (sourceColumn p >= sourceColumn startIndexPos) i <- L.decimal void (char del) alevel' <- (<> pos1) <$> L.indentLevel diff --git a/tests/Text/MMarkSpec.hs b/tests/Text/MMarkSpec.hs index c8f6088..29e5700 100644 --- a/tests/Text/MMarkSpec.hs +++ b/tests/Text/MMarkSpec.hs @@ -106,7 +106,7 @@ spec = parallel $ do "

Foo

\n

bar

\n" it "CM30" $ "* Foo\n* * *\n* Bar" ==-> - "\n" + "\n" it "CM31" $ "- Foo\n- * * *" ==-> "\n" @@ -568,7 +568,7 @@ spec = parallel $ do "\n\n
code\n
\n" it "CM271" $ "- a\n - b\n - c\n - d\n - e\n - f\n - g\n - h\n- i" ==-> - "\n" + "\n" it "CM272" $ "1. a\n\n 2. b\n\n 3. c" ==-> "
    \n
  1. \n

    a

    \n
  2. \n
  3. \n

    b

    \n
  4. \n
  5. \n

    c

    \n
  6. \n
\n" @@ -610,7 +610,7 @@ spec = parallel $ do "\n" it "CM285" $ "- a\n - b\n - c\n\n- d\n - e\n - f" ==-> - "\n" + "\n" context "6 Inlines" $ it "CM286" $ let s = "`hi`lo`\n"