diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-07-02 20:44:19 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-07-02 20:44:19 -0700 |
commit | 0da863f951e02e061d1112b50ece6b346bb0035d (patch) | |
tree | c1dfe43384cb0b60426c89ebae4e8e69f93fa046 /src | |
parent | e973bbbbc8330ded96e2ed7aec678bd90f014ae5 (diff) | |
download | pandoc-0da863f951e02e061d1112b50ece6b346bb0035d.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 7 |
1 files changed, 3 insertions, 4 deletions
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 |