aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-04-18 22:01:12 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-04-18 22:01:12 -0700
commit73d394ca2adff31a384404ae25665b36c7d0bba0 (patch)
tree0427ac6cd442c0f8531753d233bf33c4bafcf3d3
parent8d584b5826d43298c9b86f57c429a2a16092ef97 (diff)
downloadpandoc-73d394ca2adff31a384404ae25665b36c7d0bba0.tar.gz
Use MetaInlines not MetaBlocks for multimarkdown metadata fields.
This gives better results in converting to e.g. pandoc markdown. Ref: <https://groups.google.com/d/msgid/pandoc-discuss/9728d1f4-040e-4392-aa04-148f648a8dfdn%40googlegroups.com>
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs2
-rw-r--r--test/command/mmd-metadata.md20
2 files changed, 21 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 6c3947a81..4b20e3a8b 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -298,7 +298,7 @@ kvPair allowEmpty = try $ do
(try $ newline >> lookAhead (blankline <|> nonspaceChar))
guard $ allowEmpty || not (T.null val)
let key' = T.concat $ T.words $ T.toLower key
- let val' = MetaBlocks $ B.toList $ B.plain $ B.text val
+ let val' = MetaInlines $ B.toList $ B.text val
return (key',val')
parseMarkdown :: PandocMonad m => MarkdownParser m Pandoc
diff --git a/test/command/mmd-metadata.md b/test/command/mmd-metadata.md
new file mode 100644
index 000000000..3cda34873
--- /dev/null
+++ b/test/command/mmd-metadata.md
@@ -0,0 +1,20 @@
+```
+% pandoc -f markdown_mmd -t markdown -s
+Title: Blah blah blah
+Author: Doo de Doo
+Base Header Level: 1
+Bibliography: Pubs.bib
+Lang: en-GB
+
+body
+^D
+---
+author: Doo de Doo
+baseheaderlevel: 1
+bibliography: Pubs.bib
+lang: en-GB
+title: Blah blah blah
+---
+
+body
+```