blob: a7697d59e29c31b76af72f3d6d9fc1a77b382de1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
module Issue.Text
( stripIssueMarkers,
issueMarkers,
)
where
import Control.Arrow (first)
import Data.Text qualified as T
issueMarkers :: [T.Text]
issueMarkers =
[ "TODO",
"FIXME",
"QUESTION"
]
stripIssueMarkers :: T.Text -> ([T.Text], T.Text)
stripIssueMarkers text =
case [marker | marker <- issueMarkers, T.isPrefixOf marker text] of
(marker : _) ->
first (marker :) . stripIssueMarkers $
T.stripStart (T.drop (T.length marker) text)
[] ->
([], text)
|