aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-10-20 20:26:08 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-10-20 20:26:08 -0700
commit7f6bbfadf43ace8b8b75e787916ed35ae2e6b1e6 (patch)
treee81671c20da5dfb21f17857b8aafa6177a2163e8 /src/Text/Pandoc
parent88812c41ce61398bf3357a79b578774351a8a39a (diff)
downloadpandoc-7f6bbfadf43ace8b8b75e787916ed35ae2e6b1e6.tar.gz
Pretty: Make CR + BLANKLINE = BLANKLINE.
This fixes an extra blank line we were getting at the end of markdown fragments (as well as rst, org, etc.) Closes #1705.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Pretty.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Pretty.hs b/src/Text/Pandoc/Pretty.hs
index 1e72c2040..9ee7fe94a 100644
--- a/src/Text/Pandoc/Pretty.hs
+++ b/src/Text/Pandoc/Pretty.hs
@@ -286,6 +286,9 @@ renderList (BlankLines num : xs) = do
| otherwise -> replicateM_ (1 + num - newlines st) (outp (-1) "\n")
renderList xs
+renderList (CarriageReturn : BlankLines m : xs) =
+ renderList (BlankLines m : xs)
+
renderList (CarriageReturn : xs) = do
st <- get
if newlines st > 0 || null xs