Muse reader: parse Emacs Muse directives without parseFromString
Also require space (not newline) after directive name.
This commit is contained in:
parent
fc5d79b6e9
commit
9e21ae15e1
1 changed files with 2 additions and 4 deletions
|
@ -156,10 +156,8 @@ parseDirectiveKey = do
|
||||||
parseEmacsDirective :: PandocMonad m => MuseParser m (String, F Inlines)
|
parseEmacsDirective :: PandocMonad m => MuseParser m (String, F Inlines)
|
||||||
parseEmacsDirective = do
|
parseEmacsDirective = do
|
||||||
key <- parseDirectiveKey
|
key <- parseDirectiveKey
|
||||||
space
|
spaceChar
|
||||||
spaces
|
value <- trimInlinesF . mconcat <$> manyTill (choice inlineList) eol
|
||||||
raw <- manyTill anyChar eol
|
|
||||||
value <- parseFromString (trimInlinesF . mconcat <$> many inline) raw
|
|
||||||
return (key, value)
|
return (key, value)
|
||||||
|
|
||||||
parseAmuseDirective :: PandocMonad m => MuseParser m (String, F Inlines)
|
parseAmuseDirective :: PandocMonad m => MuseParser m (String, F Inlines)
|
||||||
|
|
Loading…
Reference in a new issue