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