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:
parent
f501ad031d
commit
fb5ba1bb00
2 changed files with 14 additions and 2 deletions
|
@ -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
|
||||
|
|
12
test/command/yaml-with-chomp.md
Normal file
12
test/command/yaml-with-chomp.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
```
|
||||
% pandoc -s -t native
|
||||
---
|
||||
ml: |-
|
||||
TEST
|
||||
|
||||
BLOCK
|
||||
...
|
||||
^D
|
||||
Pandoc (Meta {unMeta = fromList [("ml",MetaBlocks [Para [Str "TEST"],Plain [Str "BLOCK"]])]})
|
||||
[]
|
||||
```
|
Loading…
Add table
Reference in a new issue