summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Metadata.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs
index 209c3ec6f..c568dc478 100644
--- a/src/Text/Pandoc/Readers/Metadata.hs
+++ b/src/Text/Pandoc/Readers/Metadata.hs
@@ -83,9 +83,11 @@ normalizeMetaValue pMetaValue x =
-- `|` or `>` will.
if "\n" `T.isSuffixOf` (T.dropWhileEnd isSpaceChar x) -- see #6823
then parseFromString' pMetaValue (x <> "\n\n")
- else parseFromString' asInlines (T.dropWhile isSpaceOrNlChar x)
- -- see #8358
- where asInlines = fmap b2i <$> pMetaValue
+ else try (parseFromString' asInlines x') -- see #8358
+ <|> -- see #8465
+ parseFromString' asInlines (x' <> "\n\n")
+ where x' = T.dropWhile isSpaceOrNlChar x
+ asInlines = fmap b2i <$> pMetaValue
b2i (MetaBlocks bs) = MetaInlines (blocksToInlines bs)
b2i y = y
isSpaceChar ' ' = True