From 0da863f951e02e061d1112b50ece6b346bb0035d Mon Sep 17 00:00:00 2001
From: John MacFarlane <fiddlosopher@gmail.com>
Date: Tue, 2 Jul 2013 20:44:19 -0700
Subject: Markdown writer:  Changed condition for rendering title block.

Previously it was only rendered if title, author, or date set.
Now any metadata field can be set.
---
 src/Text/Pandoc/Writers/Markdown.hs | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'src')

diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index e01b4a2ff..9c9bfa906 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -198,10 +198,9 @@ pandocToMarkdown opts (Pandoc meta blocks) = do
                (if isEmpty refs' then empty else blankline <> refs')
   let context  = defField "toc" (render' toc)
                $ defField "body" main
-               $ (if not (null (docTitle meta) && null (docAuthors meta)
-                           && null (docDate meta))
-                     then defField "titleblock" (render' titleblock)
-                     else id)
+               $ (if isNullMeta meta
+                     then id
+                     else defField "titleblock" (render' titleblock))
                $ metadata
   if writerStandalone opts
      then return $ renderTemplate' (writerTemplate opts) context
-- 
cgit v1.2.3