From 46d343f47487c330ad5f7ca0f6d97f17bcd4a98a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 13 Nov 2014 23:40:18 -0800 Subject: Fixed bug in org with bulleted lists: - a - b * c was being parsed as a list, even though an unindented `*` should make a heading. See . --- src/Text/Pandoc/Readers/Org.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Text/Pandoc/Readers/Org.hs') 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 = "*+-" -- cgit v1.2.3