From ecd39ed5873a44f060b6b9c49a4b83f78862cab9 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 11 Jul 2010 07:25:56 +0300 Subject: [PATCH] Added jsonRaw function --- Yesod/Json.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Yesod/Json.hs b/Yesod/Json.hs index 1a12518b..2ae8ccde 100644 --- a/Yesod/Json.hs +++ b/Yesod/Json.hs @@ -10,6 +10,7 @@ module Yesod.Json , jsonScalar , jsonList , jsonMap + , jsonRaw #if TEST , testSuite #endif @@ -114,6 +115,12 @@ jsonMap (x:xs) = mconcat , v ] +-- | Outputs raw JSON data without performing any escaping. Use with caution: +-- this is the only function in this module that allows you to create broken +-- JSON documents. +jsonRaw :: S.ByteString -> Json +jsonRaw bs = Json $ unsafeByteString bs + #if TEST testSuite :: Test