diff --git a/Criterion/Report.hs b/Criterion/Report.hs index 833bca78..e3ee9201 100644 --- a/Criterion/Report.hs +++ b/Criterion/Report.hs @@ -32,12 +32,13 @@ module Criterion.Report ) where import Control.Exception (Exception, IOException, throwIO) -import Control.Monad (mplus, unless) +import Control.Monad (mplus) import Control.Monad.IO.Class (MonadIO(liftIO)) import Control.Monad.Reader (ask) import Criterion.Monad (Criterion) import Criterion.Types import Data.Aeson (ToJSON (..), Value(..), object, (.=), Value) +import Data.Aeson.Text (encodeToLazyText) import Data.Data (Data, Typeable) import Data.Foldable (forM_) import GHC.Generics (Generic) @@ -46,8 +47,8 @@ import Statistics.Function (minMax) import System.Directory (doesFileExist) import System.FilePath ((), (<.>), isPathSeparator) import System.IO (hPutStrLn, stderr) -import Text.Microstache (Key (..), MustacheWarning (..), Node (..), Template (..), - compileMustacheText, displayMustacheWarning, renderMustacheW) +import Text.Microstache (Key (..), Node (..), Template (..), + compileMustacheText, displayMustacheWarning, renderMustacheW) import Prelude () import Prelude.Compat import qualified Control.Exception as E @@ -103,6 +104,34 @@ report reports = do tpl <- loadTemplate [td,"."] template TL.writeFile name =<< formatReport reports tpl +-- | Escape JSON string aimed to be embedded in an HTML @@ -32,8 +35,6 @@
- -