From b87674a9ad1aece973da49197182a08ac65cd2df Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 5 Oct 2023 10:57:59 +0200 Subject: fix trailing newline in text extract, fix tests --- app/Issue/Text.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/Issue') diff --git a/app/Issue/Text.hs b/app/Issue/Text.hs index 2d3aac4..2637598 100644 --- a/app/Issue/Text.hs +++ b/app/Issue/Text.hs @@ -15,7 +15,7 @@ extractText :: FileType -> Text -> (Text, Maybe Text) extractText fileType rawText = (title, description) where text = stripComments fileType $ stripLines rawText - stripLines = T.unlines . map T.strip . T.lines + stripLines = T.intercalate "\n" . map T.strip . T.lines (title, description') = second T.stripStart $ T.breakOn "\n\n" text description | T.null description' = Nothing @@ -41,7 +41,7 @@ stripLineComments lineStart text = ) text where - onLines f = T.unlines . map f . T.lines + onLines f = T.intercalate "\n" . map f . T.lines stripBlockComment :: Text -> Text -> Text -> Text stripBlockComment blockStart blockEnd text = -- cgit v1.2.3