aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-11-13 23:40:18 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-11-13 23:40:18 -0800
commit46d343f47487c330ad5f7ca0f6d97f17bcd4a98a (patch)
tree2c152e900270a7a6935c52e676e1cab532fd8407 /src/Text/Pandoc/Readers/Org.hs
parentbd245450c49380c029cfe0aab9e1024d6210f624 (diff)
downloadpandoc-46d343f47487c330ad5f7ca0f6d97f17bcd4a98a.tar.gz
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 <http://orgmode.org/manual/Plain-lists.html#fn-1>.
Diffstat (limited to 'src/Text/Pandoc/Readers/Org.hs')
-rw-r--r--src/Text/Pandoc/Readers/Org.hs10
1 files changed, 5 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 = "*+-"