aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolay Yakimov <root@livid.pp.ru>2015-03-28 07:07:03 +0300
committerNikolay Yakimov <root@livid.pp.ru>2015-03-28 07:07:03 +0300
commit5f7639a0d6e74527930b2c8060898df5177ce82e (patch)
tree46b4b25429713ad8bc84d6831a2730b7a480457d
parent7091002966bf6cacc6674a195fd03696dc71edf5 (diff)
downloadpandoc-5f7639a0d6e74527930b2c8060898df5177ce82e.tar.gz
Markdown Reader: Require nonempty value in mmd title block
`many1Till` will gobble up newline, and then whole following line will match, so I had to use guard here.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 9d37808ee..8892f60fb 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -329,6 +329,7 @@ kvPair = try $ do
skipMany1 spaceNoNewline
val <- manyTill anyChar
(try $ newline >> lookAhead (blankline <|> nonspaceChar))
+ guard $ not . null . trim $ val
let key' = concat $ words $ map toLower key
let val' = MetaBlocks $ B.toList $ B.plain $ B.text $ trim val
return (key',val')