diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-10-05 10:03:31 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-10-05 10:03:31 +0200 |
commit | 16da8a1ea6187f4bd5ef176f2aed64403b111c8c (patch) | |
tree | f304e9983afa5b9170e29f7bf0df7933e2aa1c4c /app/Issue.hs | |
parent | 1890844c731b4c5c648b1871193947144aefa3dd (diff) |
generate internal @id tag from title
Diffstat (limited to 'app/Issue.hs')
-rw-r--r-- | app/Issue.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/Issue.hs b/app/Issue.hs index 249ce92..07bddee 100644 --- a/app/Issue.hs +++ b/app/Issue.hs @@ -20,24 +20,27 @@ data Issue = Issue description :: Maybe Text, start :: G.Position, end :: G.Position, - tags :: [Tag] + tags :: [Tag], + internalTags :: [Tag] } fromMatch :: G.Result -> G.Match -> Maybe Issue fromMatch result match = - if T.isPrefixOf marker title + if T.isPrefixOf marker title' then Just Issue - { title = stripMarker title, + { title = title, description = stripTags <$> description, start = match.start, end = match.end, - tags = maybe [] I.extract description + tags = maybe [] I.extractTags description, + internalTags = I.internalTags title } else Nothing where - (title, description) = I.extractText result.file_type match.text + (title', description) = I.extractText result.file_type match.text + title = stripMarker title' marker :: Text marker = "TODO" |