From a49ecc9fe707d3dd2c68929f35c3b390ae5ae6e7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 12 Feb 2013 19:55:37 -0800 Subject: 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. --- src/Text/Pandoc/Readers/Markdown.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3