From c28428fd8c61cfd21adba5b5fbefc0f8a1784da8 Mon Sep 17 00:00:00 2001 From: Bergi Date: Tue, 20 Mar 2018 12:57:58 +0100 Subject: Make Pandoc dependency optional --- tests/TestSuite/Util.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/TestSuite') diff --git a/tests/TestSuite/Util.hs b/tests/TestSuite/Util.hs index 33b26ef..fa411f8 100644 --- a/tests/TestSuite/Util.hs +++ b/tests/TestSuite/Util.hs @@ -8,6 +8,7 @@ module TestSuite.Util , testCompilerDone , testConfiguration , cleanTestEnv + , renderParagraphs ) where @@ -29,6 +30,7 @@ import Hakyll.Core.Provider import Hakyll.Core.Store (Store) import qualified Hakyll.Core.Store as Store import Hakyll.Core.Util.File +import Hakyll.Core.Item -------------------------------------------------------------------------------- @@ -102,3 +104,13 @@ cleanTestEnv = do removeDirectory $ destinationDirectory testConfiguration removeDirectory $ storeDirectory testConfiguration removeDirectory $ tmpDirectory testConfiguration + + +-------------------------------------------------------------------------------- +-- | like 'Hakyll.Web.Pandoc.renderPandoc' +-- | but allowing to test without the @usePandoc@ flag +renderParagraphs :: Item String -> Compiler (Item String) +renderParagraphs = withItemBody (return + . intercalate "\n" -- no trailing line + . map (("

"++) . (++"

")) + . lines) -- cgit v1.2.3