diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-10-05 16:27:29 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-10-05 16:33:33 +0300 |
commit | abd770c691ce09ff74e175f5bd25de2058d3c766 (patch) | |
tree | 99ccf41e6d95d2ab4f855ebf429e9fc1eea1b944 | |
parent | 0ce7183c81715ce212196f64ba916fd5d9a5c0dd (diff) | |
download | pandoc-abd770c691ce09ff74e175f5bd25de2058d3c766.tar.gz |
Muse reader internals: simplify parseMuse
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 8e1f3a2af..aaa9d2eb1 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -123,13 +123,9 @@ instance HasLogMessages MuseState where parseMuse :: PandocMonad m => MuseParser m Pandoc parseMuse = do many directive - firstSection <- parseBlocks - rest <- many parseSection - let blocks = mconcat (firstSection : rest) + blocks <- (:) <$> parseBlocks <*> many parseSection st <- getState - let doc = runF (do Pandoc _ bs <- B.doc <$> blocks - meta <- museMeta st - return $ Pandoc meta bs) st + let doc = runF (Pandoc <$> museMeta st <*> fmap B.toList (mconcat blocks)) st reportLogMessages return doc |