aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-08-17 10:29:12 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-08-17 10:29:12 -0700
commit5a5a2522163d73c3b91db2cb2b73e697a5dcfb23 (patch)
tree5d1851d20749fd2b83253988495bc13be080158f /src/Text
parentcaa89efc32d0ebaa34eb9eb8dc110e9af8d6d051 (diff)
downloadpandoc-5a5a2522163d73c3b91db2cb2b73e697a5dcfb23.tar.gz
Markdown reader: Don't generate blank title, author, date elements.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 251554de1..906dd10f2 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -221,9 +221,9 @@ pandocTitleBlock = try $ do
title' <- title
author' <- author
date' <- date
- return $ B.setMeta "title" title'
- . B.setMeta "author" author'
- . B.setMeta "date" date'
+ return $ if B.isNull title' then id else B.setMeta "title" title'
+ . if null author' then id else B.setMeta "author" author'
+ . if B.isNull date' then id else B.setMeta "date" date'
yamlTitleBlock :: MarkdownParser (F (Pandoc -> Pandoc))
yamlTitleBlock = try $ do