diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 4 | ||||
-rw-r--r-- | test/command/yaml-with-chomp.md | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 8977517c1..a94c85c32 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -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 diff --git a/test/command/yaml-with-chomp.md b/test/command/yaml-with-chomp.md new file mode 100644 index 000000000..d4c4f7cfd --- /dev/null +++ b/test/command/yaml-with-chomp.md @@ -0,0 +1,12 @@ +``` +% pandoc -s -t native +--- +ml: |- + TEST + + BLOCK +... +^D +Pandoc (Meta {unMeta = fromList [("ml",MetaBlocks [Para [Str "TEST"],Plain [Str "BLOCK"]])]}) +[] +``` |