summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2013-03-27 14:02:56 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2013-03-27 14:02:56 +0100
commitdbffc5ef10bc73e2abd1712d1bcb6dcf06bf75b3 (patch)
tree3a1597c24d641d41e0cebcb38db5bc20cfcad626 /src
parente552896338fe369b363160111099af99b7f1d265 (diff)
downloadhakyll-dbffc5ef10bc73e2abd1712d1bcb6dcf06bf75b3.tar.gz
Check for mailto: URLs
Closes #127
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Check.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/Hakyll/Check.hs b/src/Hakyll/Check.hs
index 73606b3..5c05aa5 100644
--- a/src/Hakyll/Check.hs
+++ b/src/Hakyll/Check.hs
@@ -131,9 +131,15 @@ checkFile filePath = do
let urls = getUrls $ TS.parseTags contents
forM_ urls $ \url -> do
Logger.debug logger $ "Checking link " ++ url
- if isExternal url
- then checkExternalUrl url
- else checkInternalUrl filePath url
+ checkUrl filePath url
+
+
+--------------------------------------------------------------------------------
+checkUrl :: FilePath -> String -> Checker ()
+checkUrl filePath url
+ | isExternal url = checkExternalUrl url
+ | "mailto:" `isPrefixOf` url = ok url
+ | otherwise = checkInternalUrl filePath url
--------------------------------------------------------------------------------