From 204d3f4a393cc1be5d0872e6fd53d014ede191a5 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 13 Dec 2021 23:50:09 +0100 Subject: complain if map links that don't go to .json files --- lib/Paths.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Paths.hs') diff --git a/lib/Paths.hs b/lib/Paths.hs index b849cf6..83c065f 100644 --- a/lib/Paths.hs +++ b/lib/Paths.hs @@ -68,3 +68,9 @@ isOldStyle (Path _ text frag) = path =~ ("{<.+>*}" :: Text) where path = case frag of Just f -> text <> f _ -> text + +getExtension :: RelPath -> Text +getExtension (Path _ text frag) = case length splitted of + 0 -> "" + _ -> last splitted + where splitted = T.splitOn "." text -- cgit v1.2.3