aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-11-11 10:17:53 -0500
committerJohn MacFarlane <jgm@berkeley.edu>2017-11-11 10:17:53 -0500
commitfb5ba1bb00a0d328db568952925f543b2bd8b584 (patch)
tree55d10d99dcad401cb301d994801b862fc7852e34 /src
parentf501ad031d4afb653d00c2a88856c903ed87d9b5 (diff)
downloadpandoc-fb5ba1bb00a0d328db568952925f543b2bd8b584.tar.gz
Fixed YAML metadata with "chomp" (`|-`).
Previously if a YAML block under `|-` contained a blank line, pandoc would not parse it as metadata.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs4
1 files changed, 2 insertions, 2 deletions
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