diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index f4aca92d0..995a3ae9e 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -157,16 +157,14 @@ parseEmacsDirective = do parseAmuseDirective :: PandocMonad m => MuseParser m (String, F Inlines) parseAmuseDirective = do key <- parseDirectiveKey - space - spaces - first <- manyTill anyChar eol - rest <- manyTill anyLine endOfDirective + many1 spaceChar + value <- trimInlinesF . mconcat <$> many1Till inline endOfDirective many blankline - value <- parseFromString (trimInlinesF . mconcat <$> many inline) $ unlines (first : rest) return (key, value) where - endOfDirective = lookAhead $ endOfInput <|> try (void blankline) <|> try (void parseDirectiveKey) - endOfInput = try $ skipMany blankline >> skipSpaces >> eof + endOfDirective = lookAhead $ try (eof <|> + void (newline >> blankline) <|> + void (newline >> parseDirectiveKey)) directive :: PandocMonad m => MuseParser m () directive = do |