diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2019-05-11 09:51:19 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2019-05-11 10:12:08 +0300 |
commit | 692f88fd8fd343478428407a21a71b3d1e9cdbe8 (patch) | |
tree | 48d2d9b4d839712c6f887129d905fd340dd8fb73 /src/Text/Pandoc | |
parent | 53874d8bd63eac897a78bec0ecf8a81394153169 (diff) | |
download | pandoc-692f88fd8fd343478428407a21a71b3d1e9cdbe8.tar.gz |
Reduce the amount of state in FB2 reader
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/FB2.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/FB2.hs b/src/Text/Pandoc/Readers/FB2.hs index cc10913e2..484d5ceb8 100644 --- a/src/Text/Pandoc/Readers/FB2.hs +++ b/src/Text/Pandoc/Readers/FB2.hs @@ -62,7 +62,9 @@ instance HasMeta FB2State where readFB2 :: PandocMonad m => ReaderOptions -> Text -> m Pandoc readFB2 _ inp = do - (bs, st) <- runStateT (mapM parseBlock $ parseXML (crFilter inp)) def + let parsedXml = parseXML $ crFilter inp + + (bs, st) <- runStateT (mapM parseBlock $ parsedXml) def let authors = if null $ fb2Authors st then id else setMeta "author" (map text $ reverse $ fb2Authors st) |