git.iko.soy/typeable/pandoc
on master help sign in
Txt2Tags Reader: Fixed crash when reading from stdin
commitaa808055f04951e4d6f580764ca755c4391c96b1 authormpickering <matthewtpickering@gmail.com> dateThu 21 Aug 2014, 17:11 (12 years ago) parent3b6d7af
1 file changed+5−3
src/Text/Pandoc/Readers/Txt2Tags.hs+5−3
src/Text/Pandoc/Readers/Txt2Tags.hs+5−3
@@ -75,9 +75,11 @@ getT2TMeta inps out = do
7575 curDate <- formatTime defaultTimeLocale "%F" <$> getZonedTime
7676 let getModTime = fmap (formatTime defaultTimeLocale "%T") .
7777 getModificationTime
78− curMtime <- catchIOError
79− (maximum <$> mapM getModTime inps)
80− (const (return ""))
78+ curMtime <- case inps of
79+ [] -> formatTime defaultTimeLocale "%T" <$> getZonedTime
80+ _ -> catchIOError
81+ (maximum <$> mapM getModTime inps)
82+ (const (return ""))
8183 return $ T2TMeta curDate curMtime (intercalate ", " inps) out
8284
8385-- | Read Txt2Tags from an input string returning a Pandoc document