diff --git a/Text/Blaze/Renderer/Utf8.hs b/Text/Blaze/Renderer/Utf8.hs index 9c65286..812e488 100644 --- a/Text/Blaze/Renderer/Utf8.hs +++ b/Text/Blaze/Renderer/Utf8.hs @@ -20,7 +20,7 @@ import qualified Text.Blaze.Builder.Html as B -- fromChoiceString :: ChoiceString -- ^ String to render -> Builder -- ^ Resulting builder -fromChoiceString (Static s) = B.fromByteString $ getUtf8ByteString s +fromChoiceString (Static s) = B.copyByteString $ getUtf8ByteString s fromChoiceString (String s) = B.fromHtmlEscapedString s fromChoiceString (Text s) = B.fromHtmlEscapedText s fromChoiceString (ByteString s) = B.fromByteString s @@ -47,17 +47,17 @@ renderBuilder = go mempty where go :: Builder -> HtmlM b -> Builder go attrs (Parent open close content) = - B.fromByteString (getUtf8ByteString open) + B.copyByteString (getUtf8ByteString open) `mappend` attrs `mappend` B.fromChar '>' `mappend` go mempty content - `mappend` B.fromByteString (getUtf8ByteString close) + `mappend` B.copyByteString (getUtf8ByteString close) go attrs (Leaf begin end) = - B.fromByteString (getUtf8ByteString begin) + B.copyByteString (getUtf8ByteString begin) `mappend` attrs - `mappend` B.fromByteString (getUtf8ByteString end) + `mappend` B.copyByteString (getUtf8ByteString end) go attrs (AddAttribute key value h) = - go (B.fromByteString (getUtf8ByteString key) + go (B.copyByteString (getUtf8ByteString key) `mappend` fromChoiceString value `mappend` B.fromChar '"' `mappend` attrs) h