diff options
author | Bergi <a.d.bergi@web.de> | 2018-03-20 12:57:58 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2018-03-20 07:57:58 -0400 |
commit | c28428fd8c61cfd21adba5b5fbefc0f8a1784da8 (patch) | |
tree | 35b65d133801b4e6fed8effd2286628d16f8a6ee /tests/TestSuite | |
parent | 9a23bfb129ca799cdeb9e893dcc82afbff742fb3 (diff) | |
download | hakyll-c28428fd8c61cfd21adba5b5fbefc0f8a1784da8.tar.gz |
Make Pandoc dependency optional
Diffstat (limited to 'tests/TestSuite')
-rw-r--r-- | tests/TestSuite/Util.hs | 12 |
1 files changed, 12 insertions, 0 deletions
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 (("<p>"++) . (++"</p>")) + . lines) |