mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-24 09:16:43 +00:00
Fixed YAML metadata with "chomp" (|-).
Previously if a YAML block under `|-` contained a blank line, pandoc would not parse it as metadata.
This commit is contained in:
@@ -290,8 +290,8 @@ toMetaValue :: PandocMonad m
|
||||
toMetaValue x =
|
||||
parseFromString' parser' (T.unpack x)
|
||||
where parser' = (asInlines <$> ((trimInlinesF . mconcat)
|
||||
<$> (guard (not endsWithNewline)
|
||||
*> manyTill inline eof)))
|
||||
<$> try (guard (not endsWithNewline)
|
||||
*> manyTill inline eof)))
|
||||
<|> (asBlocks <$> parseBlocks)
|
||||
asBlocks p = do
|
||||
p' <- p
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
```
|
||||
% pandoc -s -t native
|
||||
---
|
||||
ml: |-
|
||||
TEST
|
||||
|
||||
BLOCK
|
||||
...
|
||||
^D
|
||||
Pandoc (Meta {unMeta = fromList [("ml",MetaBlocks [Para [Str "TEST"],Plain [Str "BLOCK"]])]})
|
||||
[]
|
||||
```
|
||||
Reference in New Issue
Block a user