summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Metadata.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs
index 05c1abc75..209c3ec6f 100644
--- a/src/Text/Pandoc/Readers/Metadata.hs
+++ b/src/Text/Pandoc/Readers/Metadata.hs
@@ -82,14 +82,18 @@ normalizeMetaValue pMetaValue x =
-- not end in a newline, but a "block" set off with
-- `|` or `>` will.
if "\n" `T.isSuffixOf` (T.dropWhileEnd isSpaceChar x) -- see #6823
- then parseFromString' pMetaValue (x <> "\n")
- else parseFromString' asInlines x
+ then parseFromString' pMetaValue (x <> "\n\n")
+ else parseFromString' asInlines (T.dropWhile isSpaceOrNlChar x)
+ -- see #8358
where asInlines = fmap b2i <$> pMetaValue
b2i (MetaBlocks bs) = MetaInlines (blocksToInlines bs)
b2i y = y
isSpaceChar ' ' = True
isSpaceChar '\t' = True
isSpaceChar _ = False
+ isSpaceOrNlChar '\r' = True
+ isSpaceOrNlChar '\n' = True
+ isSpaceOrNlChar c = isSpaceChar c
yamlToMetaValue :: (PandocMonad m, HasLastStrPosition st)
=> ParsecT Sources st m (Future st MetaValue)