From bcfb77e2ab832d97b66e0bd06c35a9a13be437da Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Mar 2017 12:47:39 +0100 Subject: Markdown writer: Avoid spurious blanklines at end of document... after tables and list, for example. --- src/Text/Pandoc/Writers/Markdown.hs | 2 +- test/command/2834.md | 3 --- test/command/3337.md | 3 --- test/command/3487.md | 2 -- test/tables.markdown | 2 -- test/tables.plain | 2 -- test/writer.opml | 10 +++++----- 7 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 782d0d085..ab986208d 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -214,7 +214,7 @@ pandocToMarkdown opts (Pandoc meta blocks) = do body <- blockListToMarkdown opts blocks' notesAndRefs' <- notesAndRefs opts let render' :: Doc -> String - render' = render colwidth + render' = render colwidth . chomp let main = render' $ body <> notesAndRefs' let context = defField "toc" (render' toc) $ defField "body" main diff --git a/test/command/2834.md b/test/command/2834.md index e4c2b3da5..850c39254 100644 --- a/test/command/2834.md +++ b/test/command/2834.md @@ -26,7 +26,4 @@ Nested grid tables. | | ----------- | | | +------------------------------------------------------------------+ | +-----------------------------------------------------------------------+ - - - ``` diff --git a/test/command/3337.md b/test/command/3337.md index 8f6735f0f..7ba14dcbb 100644 --- a/test/command/3337.md +++ b/test/command/3337.md @@ -9,8 +9,5 @@ a 1 2 --- --- - - - ``` diff --git a/test/command/3487.md b/test/command/3487.md index 2f3e2f24a..1d475676f 100644 --- a/test/command/3487.md +++ b/test/command/3487.md @@ -8,6 +8,4 @@ Some text Some text - element - - ``` diff --git a/test/tables.markdown b/test/tables.markdown index 4b5754cf9..7f89bfc08 100644 --- a/test/tables.markdown +++ b/test/tables.markdown @@ -74,5 +74,3 @@ Multiline table without column headers: the blank line between rows. ----------- ---------- ------------ -------------------------- - - diff --git a/test/tables.plain b/test/tables.plain index 4c7ebbf82..e46317a6f 100644 --- a/test/tables.plain +++ b/test/tables.plain @@ -74,5 +74,3 @@ Multiline table without column headers: the blank line between rows. ----------- ---------- ------------ -------------------------- - - diff --git a/test/writer.opml b/test/writer.opml index 261f83426..0b621823e 100644 --- a/test/writer.opml +++ b/test/writer.opml @@ -31,18 +31,18 @@ - + - + - + - + - + -- cgit v1.2.3