aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-06 21:05:28 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-06 21:05:28 -0800
commit93c3e27731321294a204c465f8b917946db38c85 (patch)
tree5ce07ded963546ad751e2640a91f6e0b9c465067 /src
parent71bedab81c012be50c6605ed0dbf4ef936cde05e (diff)
downloadpandoc-93c3e27731321294a204c465f8b917946db38c85.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/pandoc.hs8
1 files changed, 6 insertions, 2 deletions
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'