Markdown reader: Fixed regression in title blocks.

If author field was empty, date was being ignored.  Closes #1089.
This commit is contained in:
John MacFarlane 2013-12-12 22:34:13 -08:00
parent 46b37b4ddc
commit 6d0cd9203c

View file

@ -215,10 +215,10 @@ pandocTitleBlock = try $ do
author' <- author
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' )
nullMeta
(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')
$ nullMeta
updateState $ \st -> st{ stateMeta' = stateMeta' st <> meta' }
yamlMetaBlock :: MarkdownParser (F Blocks)