@@ -284,21 +284,22 @@ nodeToKey _ = fail "Non-string key in YAML mappi
284284toMetaValue :: PandocMonad m
285285 => Text -> MarkdownParser m (F MetaValue)
286286toMetaValue x =
287− parseFromString' parser' (T.unpack x)
288− where parser' = (asInlines <$> ((trimInlinesF . mconcat)
289− <$> try (guard (not endsWithNewline)
290− *> manyTill inline eof)))
291− <|> (asBlocks <$> parseBlocks)
287+ -- Note: a standard quoted or unquoted YAML value will
288+ -- not end in a newline, but a "block" set off with
289+ -- `|` or `>` will.
290+ if (T.pack "\n") `T.isSuffixOf` x
291+ then parseFromString' (asBlocks <$> parseBlocks) (xstring <> "\n")
292+ else parseFromString'
293+ ((asInlines <$> try pInlines) <|> (asBlocks <$> parseBlocks))
294+ xstring
295+ where pInlines = trimInlinesF . mconcat <$> manyTill inline eof
292296 asBlocks p = do
293297 p' <- p
294298 return $ MetaBlocks (B.toList p')
295299 asInlines p = do
296300 p' <- p
297301 return $ MetaInlines (B.toList p')
298− endsWithNewline = T.pack "\n" `T.isSuffixOf` x
299− -- Note: a standard quoted or unquoted YAML value will
300− -- not end in a newline, but a "block" set off with
301− -- `|` or `>` will.
302+ xstring = T.unpack x
302303
303304checkBoolean :: Text -> Maybe Bool
304305checkBoolean t =