@@ -230,12 +230,8 @@ convertWithOpts opts = do
230230 metadataFromFile <-
231231 case optMetadataFiles opts of
232232 [] -> return mempty
233− paths -> mapM readFileLazy paths >>= mapM (yamlToMeta readerOpts)
234− >>= return . (foldr1 (<>))
235− -- Note: this list is in reverse order from the order on the
236− -- command line. So this code ensures that metadata files
237− -- specified later in the command line take precedence over
238− -- those specified earlier.
233+ paths -> mapM readFileLazy paths >>=
234+ fmap mconcat . mapM (yamlToMeta readerOpts)
239235
240236 let transforms = (case optShiftHeadingLevelBy opts of
241237 0 -> id
@@ -286,8 +282,8 @@ convertWithOpts opts = do
286282 ( (if isJust (optExtractMedia opts)
287283 then fillMediaBag
288284 else return)
289− >=> return . adjustMetadata (<> metadataFromFile)
290− >=> return . adjustMetadata (metadata <>)
285+ >=> return . adjustMetadata (metadataFromFile <>)
286+ >=> return . adjustMetadata (<> metadata)
291287 >=> applyTransforms transforms
292288 >=> applyFilters readerOpts filters' [format]
293289 >=> maybe return extractMedia (optExtractMedia opts)