aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-02-12 19:55:37 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-02-12 19:55:37 -0800
commita49ecc9fe707d3dd2c68929f35c3b390ae5ae6e7 (patch)
tree5b409ddbb15bde607b1c02b1a0d5b8b73fc0aa6c /src
parent86dd9f1576f6dab3c254e293134b1ce8b2a6549f (diff)
downloadpandoc-a49ecc9fe707d3dd2c68929f35c3b390ae5ae6e7.tar.gz
Markdown reader: Fix title block parsing.
Now if mmd_title_blocks is specified, pandoc will parse a MMD title block if it sees one, even if pandoc_title_blocks is enabled.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 5a257a51e..1ba6d2bdd 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -195,11 +195,14 @@ dateLine = try $ do
trimInlinesF . mconcat <$> manyTill inline newline
titleBlock :: MarkdownParser (F Inlines, F [Inlines], F Inlines)
-titleBlock = pandocTitleBlock <|> mmdTitleBlock
+titleBlock = pandocTitleBlock
+ <|> mmdTitleBlock
+ <|> return (mempty, return [], mempty)
pandocTitleBlock :: MarkdownParser (F Inlines, F [Inlines], F Inlines)
pandocTitleBlock = try $ do
guardEnabled Ext_pandoc_title_block
+ lookAhead (char '%')
title <- option mempty titleLine
author <- option (return []) authorsLine
date <- option mempty dateLine