diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2018-01-07 12:20:04 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2018-01-07 12:20:04 +0100 |
commit | 4566ee4a43d5656e7695d9da6dab97e843910a3e (patch) | |
tree | 13ca0d6caa4feb34c48b3ec439bc72be9dd8a55e /lib | |
parent | 526cd35f418fe14bb0039900a00a0e024686ee34 (diff) | |
download | hakyll-4566ee4a43d5656e7695d9da6dab97e843910a3e.tar.gz |
decodeUtf8 over unsafe unpack for feed templates
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Hakyll/Web/Feed.hs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/Hakyll/Web/Feed.hs b/lib/Hakyll/Web/Feed.hs index 916a2fa..2cafe02 100644 --- a/lib/Hakyll/Web/Feed.hs +++ b/lib/Hakyll/Web/Feed.hs @@ -28,29 +28,34 @@ module Hakyll.Web.Feed -------------------------------------------------------------------------------- import Hakyll.Core.Compiler import Hakyll.Core.Item -import Hakyll.Core.Util.String (replaceAll) +import Hakyll.Core.Util.String (replaceAll) import Hakyll.Web.Template import Hakyll.Web.Template.Context import Hakyll.Web.Template.List -------------------------------------------------------------------------------- -import Data.ByteString.Char8 (unpack) -import Data.FileEmbed (embedFile) +import Data.FileEmbed (embedFile) +import qualified Data.Text as T +import qualified Data.Text.Encoding as T -------------------------------------------------------------------------------- rssTemplate :: String -rssTemplate = unpack $(embedFile "data/templates/rss.xml") +rssTemplate = T.unpack $ + T.decodeUtf8 $(embedFile "data/templates/rss.xml") rssItemTemplate :: String -rssItemTemplate = unpack $(embedFile "data/templates/rss-item.xml") +rssItemTemplate = T.unpack $ + T.decodeUtf8 $(embedFile "data/templates/rss-item.xml") atomTemplate :: String -atomTemplate = unpack $(embedFile "data/templates/atom.xml") +atomTemplate = T.unpack $ + T.decodeUtf8 $(embedFile "data/templates/atom.xml") atomItemTemplate :: String -atomItemTemplate = unpack $(embedFile "data/templates/atom-item.xml") +atomItemTemplate = T.unpack $ + T.decodeUtf8 $(embedFile "data/templates/atom-item.xml") -------------------------------------------------------------------------------- |