@@ -157,16 +157,14 @@ parseEmacsDirective = do
157157parseAmuseDirective :: PandocMonad m => MuseParser m (String, F Inlines)
158158parseAmuseDirective = do
159159 key <- parseDirectiveKey
160− space
161− spaces
162− first <- manyTill anyChar eol
163− rest <- manyTill anyLine endOfDirective
160+ many1 spaceChar
161+ value <- trimInlinesF . mconcat <$> many1Till inline endOfDirective
164162 many blankline
165− value <- parseFromString (trimInlinesF . mconcat <$> many inline) $ unlines (first : rest)
166163 return (key, value)
167164 where
168− endOfDirective = lookAhead $ endOfInput <|> try (void blankline) <|> try (void parseDirectiveKey)
169− endOfInput = try $ skipMany blankline >> skipSpaces >> eof
165+ endOfDirective = lookAhead $ try (eof <|>
166+ void (newline >> blankline) <|>
167+ void (newline >> parseDirectiveKey))
170168
171169directive :: PandocMonad m => MuseParser m ()
172170directive = do