git.iko.soy/typeable/pandoc
on master help sign in
More cleanup (#6130)

* Use an infix operator normally instead of immediately applying an operator section * Use M.fromList

commit02ff42b1783303f9f4cdd160ff0c9ff04a297126 authorJoseph C. Sible <josephcsible@users.noreply.github.com> dateSat 8 Feb 2020, 12:09 (7 years ago) parent4c3db92
2 files changed+7−8
src/Text/Pandoc/Readers/EPUB.hs+1−1 src/Text/Pandoc/Writers/JATS.hs+6−7
src/Text/Pandoc/Readers/EPUB.hs+1−1
@@ -170,7 +170,7 @@ parseMeta content = do
170170 let coverId = findAttr (emptyName "content") =<< filterChild findCover meta
171171 return (coverId, r)
172172 where
173− findCover e = (== Just "cover") (findAttr (emptyName "name") e)
173+ findCover e = findAttr (emptyName "name") e == Just "cover"
174174
175175-- http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-metadata-elem
176176parseMetaItem :: Element -> Meta -> Meta
src/Text/Pandoc/Writers/JATS.hs+6−7
@@ -92,14 +92,13 @@ docToJATS opts (Pandoc meta blocks) = do
9292 Nothing -> NullVal
9393 Just day ->
9494 let (y,m,d) = toGregorian day
95− in MapVal . Context
96− . M.insert ("year" :: Text) (SimpleVal $ text $ show y)
97− . M.insert "month" (SimpleVal $ text $ show m)
98− . M.insert "day" (SimpleVal $ text $ show d)
99− . M.insert "iso-8601"
100− (SimpleVal $ text $
95+ in MapVal . Context $ M.fromList
96+ [("year" :: Text, SimpleVal $ text $ show y)
97+ ,("month", SimpleVal $ text $ show m)
98+ ,("day", SimpleVal $ text $ show d)
99+ ,("iso-8601", SimpleVal $ text $
101100 formatTime defaultTimeLocale "%F" day)
102− $ mempty
101+ ]
103102 Just x -> x
104103 let context = defField "body" main
105104 $ defField "back" back