diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Issue.hs | 2 | ||||
-rw-r--r-- | app/Main.hs | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/app/Issue.hs b/app/Issue.hs index 66047b6..72fbad3 100644 --- a/app/Issue.hs +++ b/app/Issue.hs @@ -39,7 +39,7 @@ fromMatch result match = } else Nothing where - text = stripComments result.file_type match.text + text = stripComments result.file_type (T.strip match.text) lns = T.lines text title = takeWhile (not . isEmpty) lns description = drop (length title + 1) lns diff --git a/app/Main.hs b/app/Main.hs index 723a0a1..87951b6 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE BlockArguments #-} {-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE OverloadedRecordDot #-} {-# LANGUAGE OverloadedStrings #-} @@ -43,6 +44,7 @@ module Main where import Control.Exception (Exception, catch, throw, throwIO) +import Control.Monad (when) import Data.Aeson qualified as A import Data.ByteString.Lazy qualified as L import Data.ByteString.Lazy.Char8 qualified as L8 @@ -124,8 +126,9 @@ main = do showMatches :: Issue -> IO () showMatches issue = do T.putStrLn issue.title - T.putStrLn "" - T.putStrLn issue.description + when (not (T.null issue.description)) do + T.putStrLn "" + T.putStrLn issue.description listMatches :: Issue -> IO () listMatches issue = |