diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-20 22:36:08 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-20 22:36:08 -0800 |
commit | 8894b1a030145d903afea6e21dc61172a5f7c6c0 (patch) | |
tree | 2c6c5fe939d5c5c2c96bad0d8fc39f22f0a19868 /src | |
parent | 8011d079c8d20c118212be558ef83a43c66cfff3 (diff) | |
download | pandoc-8894b1a030145d903afea6e21dc61172a5f7c6c0.tar.gz |
Markdown writer: Avoid printing excess spaces at end if no notes/refs.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 3 |
1 files changed, 2 insertions, 1 deletions
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) |