From 5a5a2522163d73c3b91db2cb2b73e697a5dcfb23 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 17 Aug 2013 10:29:12 -0700 Subject: Markdown reader: Don't generate blank title, author, date elements. --- src/Text/Pandoc/Readers/Markdown.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3