From dbffc5ef10bc73e2abd1712d1bcb6dcf06bf75b3 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Wed, 27 Mar 2013 14:02:56 +0100 Subject: Check for mailto: URLs Closes #127 --- src/Hakyll/Check.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') 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 -------------------------------------------------------------------------------- -- cgit v1.2.3