From 114d77c2abac17d3e4676bb654f54535e0b809c9 Mon Sep 17 00:00:00 2001
From: John MacFarlane <jgm@berkeley.edu>
Date: Mon, 10 Feb 2020 08:59:19 -0800
Subject: [PATCH] Fix spurious dots in markdown_mmd metadata output

Closes #6133 (regression).
---
 src/Text/Pandoc/Writers/Markdown.hs |  2 +-
 test/command/6133.md                | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 test/command/6133.md

diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 74662083a..bce1c37fa 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -125,7 +125,7 @@ mmdTitleBlock (Context hashmap) =
                (k', SimpleVal x)
                       | isEmpty x -> empty
                       | otherwise -> k' <> ":" <> space <>
-                                     nest 2 (chomp (removeBlankLines x))
+                                     nest 2 (removeBlankLines (chomp x))
                _                  -> empty
         removeBlankLines BlankLines{} = cr <> text "." <> cr
         removeBlankLines (Concat x y) = removeBlankLines x <>
diff --git a/test/command/6133.md b/test/command/6133.md
new file mode 100644
index 000000000..f260356c2
--- /dev/null
+++ b/test/command/6133.md
@@ -0,0 +1,12 @@
+```
+% pandoc -f markdown_mmd -t markdown_mmd -s
+author: Author
+title: Title
+
+Some text
+^D
+author: Author
+title: Title
+
+Some text
+```