From fb8a2540bdb91eee0ecf620b4e9d7acf3d78042f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 30 Nov 2016 15:34:58 +0100 Subject: Options: Removed writerStandalone, made writerTemplate a Maybe. Previously setting writerStandalone = True did nothing unless a template was provided in writerTemplate. Now a fragment will be generated if writerTemplate is Nothing; otherwise, the specified template will be used and standalone output generated. [API change] --- tests/Tests/Readers/Docx.hs | 6 +++--- tests/Tests/Readers/Odt.hs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/Tests/Readers') diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs index 8ae0532e4..2fe98b8ac 100644 --- a/tests/Tests/Readers/Docx.hs +++ b/tests/Tests/Readers/Docx.hs @@ -26,11 +26,11 @@ noNorm :: Pandoc -> NoNormPandoc noNorm = NoNormPandoc instance ToString NoNormPandoc where - toString d = writeNative def{ writerStandalone = s } $ toPandoc d + toString d = writeNative def{ writerTemplate = s } $ toPandoc d where s = case d of NoNormPandoc (Pandoc (Meta m) _) - | M.null m -> False - | otherwise -> True + | M.null m -> Nothing + | otherwise -> Just "" -- need this to get meta output instance ToPandoc NoNormPandoc where toPandoc = unNoNorm diff --git a/tests/Tests/Readers/Odt.hs b/tests/Tests/Readers/Odt.hs index cd764dd62..c4fc6fcc1 100644 --- a/tests/Tests/Readers/Odt.hs +++ b/tests/Tests/Readers/Odt.hs @@ -41,11 +41,11 @@ newtype NoNormPandoc = NoNormPandoc {unNoNorm :: Pandoc} deriving ( Show ) instance ToString NoNormPandoc where - toString d = writeNative def{ writerStandalone = s } $ toPandoc d + toString d = writeNative def{ writerTemplate = s } $ toPandoc d where s = case d of NoNormPandoc (Pandoc (Meta m) _) - | M.null m -> False - | otherwise -> True + | M.null m -> Nothing + | otherwise -> Just "" -- need this for Meta output instance ToPandoc NoNormPandoc where toPandoc = unNoNorm -- cgit v1.2.3