From 8894b1a030145d903afea6e21dc61172a5f7c6c0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 20 Jan 2011 22:36:08 -0800 Subject: Markdown writer: Avoid printing excess spaces at end if no notes/refs. --- src/Text/Pandoc/Writers/Markdown.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index d402d6c12..3c0d4cc6d 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -102,7 +102,8 @@ pandocToMarkdown opts (Pandoc (Meta title authors date) blocks) = do then Just $ writerColumns opts else Nothing let main = render colwidth $ body <> - blankline <> notes' <> blankline <> refs' + (if isEmpty notes' then empty else blankline <> notes') <> + (if isEmpty refs' then empty else blankline <> refs') let context = writerVariables opts ++ [ ("toc", render colwidth toc) , ("body", main) -- cgit v1.2.3