diff options
| author | John MacFarlane <[email protected]> | 2022-12-04 11:14:43 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-12-04 11:14:43 -0800 |
| commit | a4ac1ebb954b0eaf0eac0805b8340b1609ef5d8f (patch) | |
| tree | 6564a993e71bb122cdc5e941435400f45991234f /src | |
| parent | 634696fb8784dd1f3f294e0773ce55c64eef3e00 (diff) | |
Fix metadata parsing corner case.
Closes #8465.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Readers/Metadata.hs | 8 |
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 |
