diff options
-rw-r--r-- | src/Hakyll/Check.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Hakyll/Check.hs b/src/Hakyll/Check.hs index 10e7df0..6d75e2e 100644 --- a/src/Hakyll/Check.hs +++ b/src/Hakyll/Check.hs @@ -141,13 +141,17 @@ checkUrl filePath url | hasProtocol url = skip "Unknown protocol, skipping" | otherwise = checkInternalUrl filePath url where - hasProtocol = all (`elem` validProtoChars) . takeWhile (/= ':') validProtoChars = ['A'..'Z'] ++ ['a'..'z'] ++ ['0'..'9'] ++ "+-." + hasProtocol str = case break (== ':') str of + (proto, ':' : _) -> all (`elem` validProtoChars) proto + _ -> False + -------------------------------------------------------------------------------- ok :: String -> Checker () ok _ = tell $ mempty {checkerOk = 1} + -------------------------------------------------------------------------------- skip :: String -> Checker () skip reason = do |