From 69ffbe03563cdbc7be6b826e2def2fc797442792 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 25 Dec 2012 22:49:17 +0100 Subject: Add demoteHeaders, refactor a bit --- src/Hakyll/Web/Util/Html.hs | 47 --------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/Hakyll/Web/Util/Html.hs (limited to 'src/Hakyll/Web/Util') diff --git a/src/Hakyll/Web/Util/Html.hs b/src/Hakyll/Web/Util/Html.hs deleted file mode 100644 index a413f84..0000000 --- a/src/Hakyll/Web/Util/Html.hs +++ /dev/null @@ -1,47 +0,0 @@ --- | Miscellaneous HTML manipulation functions --- -module Hakyll.Web.Util.Html - ( stripTags - , escapeHtml - ) where - -import Text.Blaze.Html (toHtml) -import Text.Blaze.Html.Renderer.String (renderHtml) - --- | Strip all HTML tags from a string --- --- Example: --- --- > stripTags "

foo

" --- --- Result: --- --- > "foo" --- --- This also works for incomplete tags --- --- Example: --- --- > stripTags "

foo "foo" --- -stripTags :: String -> String -stripTags [] = [] -stripTags ('<' : xs) = stripTags $ drop 1 $ dropWhile (/= '>') xs -stripTags (x : xs) = x : stripTags xs - --- | HTML-escape a string --- --- Example: --- --- > escapeHtml "Me & Dean" --- --- Result: --- --- > "Me & Dean" --- -escapeHtml :: String -> String -escapeHtml = renderHtml . toHtml -- cgit v1.2.3