diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Org.hs | 10 | ||||
-rw-r--r-- | tests/Tests/Readers/Org.hs | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Org.hs b/src/Text/Pandoc/Readers/Org.hs index 4c34b7bd5..579e38a38 100644 --- a/src/Text/Pandoc/Readers/Org.hs +++ b/src/Text/Pandoc/Readers/Org.hs @@ -879,18 +879,18 @@ bulletListStart = bulletListStart' Nothing bulletListStart' :: Maybe Int -> OrgParser Int -- returns length of bulletList prefix, inclusive of marker -bulletListStart' Nothing = do ind <- many spaceChar +bulletListStart' Nothing = do ind <- length <$> many spaceChar + when (ind == 0) $ notFollowedBy (char '*') oneOf bullets many1 spaceChar - return $ length ind + 1 + return (ind + 1) -- Unindented lists are legal, but they can't use '*' bullets -- We return n to maintain compatibility with the generic listItem bulletListStart' (Just n) = do count (n-1) spaceChar - oneOf validBullets + when (n == 1) $ notFollowedBy (char '*') + oneOf bullets many1 spaceChar return n - where validBullets = if n == 1 then noAsterisks else bullets - noAsterisks = filter (/= '*') bullets bullets :: String bullets = "*+-" diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index e59080bae..d1f673514 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -622,6 +622,13 @@ tests = , plain "Item2" ] + , "Unindented *" =: + ("- Item1\n" ++ + "* Item2\n") =?> + bulletList [ plain "Item1" + ] <> + header 1 "Item2" + , "Multi-line Bullet Lists" =: ("- *Fat\n" ++ " Tony*\n" ++ |