aboutsummaryrefslogtreecommitdiff
path: root/Utils.hs
diff options
context:
space:
mode:
authorMirek Kratochvil <miroslav.kratochvil@uni.lu>2023-06-13 15:53:01 +0200
committerMirek Kratochvil <miroslav.kratochvil@uni.lu>2023-06-13 15:53:01 +0200
commitc84dcab7a3ced4264da7ab317c2d96e545d5deed (patch)
treea2db09c69fa785f849afb539e27be9e1450e1aec /Utils.hs
parent3c197503380ca36c2284a8640b73eb1f6ad5bc41 (diff)
downloadreploy-c84dcab7a3ced4264da7ab317c2d96e545d5deed.tar.gz
reploy-c84dcab7a3ced4264da7ab317c2d96e545d5deed.tar.bz2
improve link rendering
Diffstat (limited to 'Utils.hs')
-rw-r--r--Utils.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utils.hs b/Utils.hs
index ea0b1ec..4828335 100644
--- a/Utils.hs
+++ b/Utils.hs
@@ -40,3 +40,9 @@ walkURLs f = Text.Pandoc.Walk.walkM go
u' <- T.pack <$> f (T.unpack u)
pure $ Image a i (u', t)
go x = pure x
+
+hasUriScheme :: String -> String -> Bool
+hasUriScheme x = all id . zipWith (==) x . (++ ":")
+
+unAbsolute :: String -> String
+unAbsolute = dropWhile (== '/')