From 93c3e27731321294a204c465f8b917946db38c85 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 6 Jan 2011 21:05:28 -0800 Subject: pandoc: Add newline to output unless standalone. This avoids output that does not end with a newline, which is inconvenient when working with many tools. Updated tests accordingly. --- src/pandoc.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pandoc.hs b/src/pandoc.hs index 373919e05..e77200e43 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -813,6 +813,10 @@ main = do writerOutput <- writer writerOptions doc'' + let writerOutput' = if standalone + then writerOutput + else writerOutput `B.snoc` 10 + if outputFile == "-" - then B.putStr writerOutput - else B.writeFile (encodeString outputFile) writerOutput + then B.putStr writerOutput' + else B.writeFile (encodeString outputFile) writerOutput' -- cgit v1.2.3