From 75e2a1104cda760a939ca12258c0355844f70a31 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Wed, 22 Nov 2017 18:49:07 +0300 Subject: Muse reader: allow list items to be empty --- src/Text/Pandoc/Readers/Muse.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index c0f8bfa01..11fea5fde 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -412,7 +412,7 @@ listStart marker = try $ do st <- stateParserContext <$> getState getPosition >>= \pos -> guard (st == ListItemState || sourceColumn pos /= 1) markerLength <- marker - many1 spaceChar + void (many1 spaceChar) <|> eol return $ preWhitespace + markerLength + 1 listItemContents :: PandocMonad m => Int -> MuseParser m (F Blocks) @@ -448,7 +448,7 @@ orderedListStart style delim = listStart (snd <$> withHorizDisplacement (ordered orderedList :: PandocMonad m => MuseParser m (F Blocks) orderedList = try $ do - p@(_, style, delim) <- lookAhead (many spaceChar *> anyOrderedListMarker <* spaceChar) + p@(_, style, delim) <- lookAhead (many spaceChar *> anyOrderedListMarker <* (eol <|> void spaceChar)) guard $ style `elem` [Decimal, LowerAlpha, UpperAlpha, LowerRoman, UpperRoman] guard $ delim == Period items <- sequence <$> many1 (listItem $ orderedListStart style delim) -- cgit v1.2.3