From f869f7e08dad315945d52be3fcacf6ff0c05c5c1 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 10 May 2013 22:53:35 -0700 Subject: Use new flexible metadata type. * Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this. --- tests/Tests/Helpers.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/Tests/Helpers.hs') diff --git a/tests/Tests/Helpers.hs b/tests/Tests/Helpers.hs index af64f5148..b48c8af3a 100644 --- a/tests/Tests/Helpers.hs +++ b/tests/Tests/Helpers.hs @@ -20,6 +20,7 @@ import Text.Pandoc.Options import Text.Pandoc.Writers.Native (writeNative) import qualified Test.QuickCheck.Property as QP import Data.Algorithm.Diff +import qualified Data.Map as M test :: (ToString a, ToString b, ToString c) => (a -> b) -- ^ function to test @@ -58,8 +59,9 @@ class ToString a where instance ToString Pandoc where toString d = writeNative def{ writerStandalone = s } $ toPandoc d where s = case d of - (Pandoc (Meta [] [] []) _) -> False - _ -> True + (Pandoc (Meta m) _) + | M.null m -> False + | otherwise -> True instance ToString Blocks where toString = writeNative def . toPandoc -- cgit v1.2.3