hakyll 3.2.2.0 → 3.2.3.0
raw patch · 3 files changed
+20/−3 lines, 3 files
Files
- hakyll.cabal +1/−1
- src/Hakyll/Web/Blaze.hs +2/−2
- src/Hakyll/Web/Util/Html.hs +17/−0
hakyll.cabal view
@@ -1,5 +1,5 @@ Name: hakyll-Version: 3.2.2.0+Version: 3.2.3.0 Synopsis: A static website compiler library Description:
src/Hakyll/Web/Blaze.hs view
@@ -12,8 +12,8 @@ import Hakyll.Web.Page import Hakyll.Web.Page.Metadata --- | Get a field from a page and convert it to HTML. This version does escape--- the given HTML+-- | Get a field from a page and convert it to HTML. This version does not+-- escape the given HTML -- getFieldHtml :: String -> Page a -> Html getFieldHtml key = preEscapedString . getField key
src/Hakyll/Web/Util/Html.hs view
@@ -2,8 +2,12 @@ -- module Hakyll.Web.Util.Html ( stripTags+ , escapeHtml ) where +import Text.Blaze (toHtml)+import Text.Blaze.Renderer.String (renderHtml)+ -- | Strip all HTML tags from a string -- -- Example:@@ -28,3 +32,16 @@ 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