From fb5ba1bb00a0d328db568952925f543b2bd8b584 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 11 Nov 2017 10:17:53 -0500 Subject: Fixed YAML metadata with "chomp" (`|-`). Previously if a YAML block under `|-` contained a blank line, pandoc would not parse it as metadata. --- src/Text/Pandoc/Readers/Markdown.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 8977517c1..a94c85c32 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -290,8 +290,8 @@ toMetaValue :: PandocMonad m toMetaValue x = parseFromString' parser' (T.unpack x) where parser' = (asInlines <$> ((trimInlinesF . mconcat) - <$> (guard (not endsWithNewline) - *> manyTill inline eof))) + <$> try (guard (not endsWithNewline) + *> manyTill inline eof))) <|> (asBlocks <$> parseBlocks) asBlocks p = do p' <- p -- cgit v1.2.3