diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-01-06 21:05:28 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-01-06 21:05:28 -0800 |
commit | 93c3e27731321294a204c465f8b917946db38c85 (patch) | |
tree | 5ce07ded963546ad751e2640a91f6e0b9c465067 /src | |
parent | 71bedab81c012be50c6605ed0dbf4ef936cde05e (diff) | |
download | pandoc-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.hs | 8 |
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' |