diff options
author | Joseph C. Sible <josephcsible@users.noreply.github.com> | 2020-02-08 12:09:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-08 09:09:33 -0800 |
commit | 02ff42b1783303f9f4cdd160ff0c9ff04a297126 (patch) | |
tree | 73529f929df080c8a0641b39d2bc99754e024818 | |
parent | 4c3db9273fc8e92c2c23d4455a6ab178472be06d (diff) | |
download | pandoc-02ff42b1783303f9f4cdd160ff0c9ff04a297126.tar.gz |
More cleanup (#6130)
* Use an infix operator normally instead of immediately applying an operator section
* Use M.fromList
-rw-r--r-- | src/Text/Pandoc/Readers/EPUB.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/JATS.hs | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Readers/EPUB.hs b/src/Text/Pandoc/Readers/EPUB.hs index f7a7de896..851d20187 100644 --- a/src/Text/Pandoc/Readers/EPUB.hs +++ b/src/Text/Pandoc/Readers/EPUB.hs @@ -170,7 +170,7 @@ parseMeta content = do let coverId = findAttr (emptyName "content") =<< filterChild findCover meta return (coverId, r) where - findCover e = (== Just "cover") (findAttr (emptyName "name") e) + findCover e = findAttr (emptyName "name") e == Just "cover" -- http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-metadata-elem parseMetaItem :: Element -> Meta -> Meta diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index 3b9c95a3a..ab95110bf 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -92,14 +92,13 @@ docToJATS opts (Pandoc meta blocks) = do Nothing -> NullVal Just day -> let (y,m,d) = toGregorian day - in MapVal . Context - . M.insert ("year" :: Text) (SimpleVal $ text $ show y) - . M.insert "month" (SimpleVal $ text $ show m) - . M.insert "day" (SimpleVal $ text $ show d) - . M.insert "iso-8601" - (SimpleVal $ text $ + in MapVal . Context $ M.fromList + [("year" :: Text, SimpleVal $ text $ show y) + ,("month", SimpleVal $ text $ show m) + ,("day", SimpleVal $ text $ show d) + ,("iso-8601", SimpleVal $ text $ formatTime defaultTimeLocale "%F" day) - $ mempty + ] Just x -> x let context = defField "body" main $ defField "back" back |