git.iko.soy/typeable/pandoc
on master help sign in
Reduce the amount of state in FB2 reader
commit692f88fd8fd343478428407a21a71b3d1e9cdbe8 authorAlexander Krotov <ilabdsf@gmail.com> dateSat 11 May 2019, 09:51 (7 years ago) parent53874d8
1 file changed+3−1
src/Text/Pandoc/Readers/FB2.hs+3−1
src/Text/Pandoc/Readers/FB2.hs+3−1
@@ -62,7 +62,9 @@ instance HasMeta FB2State where
6262
6363readFB2 :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
6464readFB2 _ inp = do
65− (bs, st) <- runStateT (mapM parseBlock $ parseXML (crFilter inp)) def
65+ let parsedXml = parseXML $ crFilter inp
66+
67+ (bs, st) <- runStateT (mapM parseBlock $ parsedXml) def
6668 let authors = if null $ fb2Authors st
6769 then id
6870 else setMeta "author" (map text $ reverse $ fb2Authors st)