blaze-builder 0.2

This commit is contained in:
Michael Snoyman 2010-11-10 09:41:42 +02:00
parent 82bab0c084
commit 125090aebb
3 changed files with 8 additions and 8 deletions

View File

@ -26,8 +26,8 @@ import Network.URI (parseURI)
import Database.Persist (PersistField) import Database.Persist (PersistField)
import Text.HTML.SanitizeXSS (sanitizeBalance) import Text.HTML.SanitizeXSS (sanitizeBalance)
import Text.Blaze.Builder.Utf8 (writeChar) import Blaze.ByteString.Builder.Char.Utf8 (writeChar)
import Text.Blaze.Builder.Core (writeList, writeByteString) import Blaze.ByteString.Builder (fromWrite4List, writeByteString)
import Yesod.Internal (lbsToChars) import Yesod.Internal (lbsToChars)
@ -87,7 +87,7 @@ newtype Textarea = Textarea { unTextarea :: String }
deriving (Show, Read, Eq, PersistField) deriving (Show, Read, Eq, PersistField)
instance ToHtml Textarea where instance ToHtml Textarea where
toHtml = toHtml =
Html . writeList writeHtmlEscapedChar . unTextarea Html . fromWrite4List writeHtmlEscapedChar . unTextarea
where where
-- Taken from blaze-builder and modified with newline handling. -- Taken from blaze-builder and modified with newline handling.
writeHtmlEscapedChar '<' = writeByteString "&lt;" writeHtmlEscapedChar '<' = writeByteString "&lt;"

View File

@ -23,8 +23,8 @@ import Data.Char (isControl)
import Yesod.Handler (GHandler) import Yesod.Handler (GHandler)
import Numeric (showHex) import Numeric (showHex)
import Data.Monoid (Monoid (..)) import Data.Monoid (Monoid (..))
import Text.Blaze.Builder.Core import Blaze.ByteString.Builder
import Text.Blaze.Builder.Utf8 (writeChar) import Blaze.ByteString.Builder.Char.Utf8 (writeChar)
#if TEST #if TEST
import Test.Framework (testGroup, Test) import Test.Framework (testGroup, Test)
@ -63,7 +63,7 @@ jsonToRepJson = fmap RepJson . jsonToContent
jsonScalar :: String -> Json jsonScalar :: String -> Json
jsonScalar s = Json $ mconcat jsonScalar s = Json $ mconcat
[ fromByteString "\"" [ fromByteString "\""
, writeList writeJsonChar s , fromWrite4List writeJsonChar s
, fromByteString "\"" , fromByteString "\""
] ]
where where

View File

@ -1,5 +1,5 @@
name: yesod name: yesod
version: 0.6.1 version: 0.6.1.1
license: BSD3 license: BSD3
license-file: LICENSE license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com> author: Michael Snoyman <michael@snoyman.com>
@ -31,7 +31,7 @@ library
, template-haskell >= 2.4 && < 2.6 , template-haskell >= 2.4 && < 2.6
, web-routes-quasi >= 0.6 && < 0.7 , web-routes-quasi >= 0.6 && < 0.7
, hamlet >= 0.5.1 && < 0.7 , hamlet >= 0.5.1 && < 0.7
, blaze-builder >= 0.1 && < 0.2 , blaze-builder >= 0.2 && < 0.3
, transformers >= 0.2 && < 0.3 , transformers >= 0.2 && < 0.3
, clientsession >= 0.4.0 && < 0.5 , clientsession >= 0.4.0 && < 0.5
, pureMD5 >= 1.1.0.0 && < 2.2 , pureMD5 >= 1.1.0.0 && < 2.2