Muse reader: parse Emacs Muse directives without parseFromString

Also require space (not newline) after directive name.
This commit is contained in:
Alexander Krotov 2018-01-19 11:29:11 +03:00
parent fc5d79b6e9
commit 9e21ae15e1

View file

@ -156,10 +156,8 @@ parseDirectiveKey = do
parseEmacsDirective :: PandocMonad m => MuseParser m (String, F Inlines)
parseEmacsDirective = do
key <- parseDirectiveKey
space
spaces
raw <- manyTill anyChar eol
value <- parseFromString (trimInlinesF . mconcat <$> many inline) raw
spaceChar
value <- trimInlinesF . mconcat <$> manyTill (choice inlineList) eol
return (key, value)
parseAmuseDirective :: PandocMonad m => MuseParser m (String, F Inlines)