summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web/Util
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-12-25 22:49:17 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-12-25 22:49:29 +0100
commit69ffbe03563cdbc7be6b826e2def2fc797442792 (patch)
tree3792ce42ee2e9983876f9177533201dd712b76d1 /src/Hakyll/Web/Util
parent2ae11c9d7f3138fe9e8397059c641e1962ede197 (diff)
downloadhakyll-69ffbe03563cdbc7be6b826e2def2fc797442792.tar.gz
Add demoteHeaders, refactor a bit
Diffstat (limited to 'src/Hakyll/Web/Util')
-rw-r--r--src/Hakyll/Web/Util/Html.hs47
1 files changed, 0 insertions, 47 deletions
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 "<p>foo</p>"
---
--- Result:
---
--- > "foo"
---
--- This also works for incomplete tags
---
--- Example:
---
--- > stripTags "<p>foo</p"
---
--- Result:
---
--- > "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 &amp; Dean"
---
-escapeHtml :: String -> String
-escapeHtml = renderHtml . toHtml