aboutsummaryrefslogtreecommitdiffstats
path: root/app/Issue.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2023-10-04 15:48:26 +0200
committerLibravatar Alexander Foremny <aforemny@posteo.de>2023-10-04 15:49:03 +0200
commit2b93e0bce102d7ccf8402b4506be9e55698f2ea9 (patch)
treea0e3b0ec50673b074285177a0f067a3d0a1bd397 /app/Issue.hs
parent80c35ec3ba6abcbb39aa140eebff5fe9468d37e4 (diff)
strip tags from description
Diffstat (limited to 'app/Issue.hs')
-rw-r--r--app/Issue.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/Issue.hs b/app/Issue.hs
index 72fbad3..0d9f6ad 100644
--- a/app/Issue.hs
+++ b/app/Issue.hs
@@ -32,7 +32,7 @@ fromMatch result match =
Just
Issue
{ title = stripMarker (T.strip (T.unlines title)),
- description = T.strip (T.unlines description),
+ description = stripTags (T.strip (T.unlines description)),
start = match.start,
end = match.end,
tags = I.extract text
@@ -48,6 +48,10 @@ fromMatch result match =
marker :: Text
marker = "TODO"
+stripTags :: Text -> Text
+stripTags text =
+ T.strip (T.unlines (filter (not . T.isPrefixOf "@") (T.lines text)))
+
stripMarker :: Text -> Text
stripMarker text = maybe text T.stripStart (T.stripPrefix marker text)