diff options
author | stuebinm | 2021-12-13 23:37:29 +0100 |
---|---|---|
committer | stuebinm | 2021-12-13 23:37:29 +0100 |
commit | ea6ef98353669ece25c6366bfdbc5bb921a44b7a (patch) | |
tree | 4484a6f28b62395d1bc89b1f0e020e589d04ca42 /lib/Paths.hs | |
parent | b8e3d6eea571435eb95d15696457a254194b6280 (diff) |
add special warning for rc3 old-style links
(the format used last year is no longer applicable to this year's event)
Diffstat (limited to 'lib/Paths.hs')
-rw-r--r-- | lib/Paths.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Paths.hs b/lib/Paths.hs index b628ee8..b849cf6 100644 --- a/lib/Paths.hs +++ b/lib/Paths.hs @@ -60,3 +60,11 @@ normalise prefix (Path i path _) = normaliseWithFrag :: FilePath -> RelPath -> FilePath normaliseWithFrag prefix (Path i path frag) = normalise prefix (Path (i+1) path frag) <> T.unpack (maybe mempty ("#" <>) frag) + +-- | does this path contain an old-style pattern for inter-repository +-- links as was used at rc3 in 2020? +isOldStyle :: RelPath -> Bool +isOldStyle (Path _ text frag) = path =~ ("{<.+>*}" :: Text) + where path = case frag of + Just f -> text <> f + _ -> text |