diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-08-17 10:29:12 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-08-17 10:29:12 -0700 |
commit | 5a5a2522163d73c3b91db2cb2b73e697a5dcfb23 (patch) | |
tree | 5d1851d20749fd2b83253988495bc13be080158f /src/Text | |
parent | caa89efc32d0ebaa34eb9eb8dc110e9af8d6d051 (diff) | |
download | pandoc-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.hs | 6 |
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 |