git.iko.soy/typeable/pandoc
on master help sign in
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.

commit93c3e27731321294a204c465f8b917946db38c85 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 6 Jan 2011, 21:05 (16 years ago) parent71bedab
22 files changed+27−12
src/pandoc.hs+6−2 tests/markdown-citations.chicago-author-date.txt+1−1 tests/markdown-citations.ieee.txt+1−1 tests/markdown-citations.txt+1−1 tests/markdown-reader-more.native+1 tests/s5.fragment.html+1−1 tests/tables-rstsubset.native+1 tests/tables.context+1−1 tests/tables.docbook+1−1 tests/tables.html+1−1 tests/tables.latex+1 tests/tables.man+1−1 tests/tables.markdown+1 tests/tables.mediawiki+1 tests/tables.native+1 tests/tables.opendocument+1−1 tests/tables.org+1 tests/tables.plain+1 tests/tables.rst+1 tests/tables.rtf+1 tests/tables.texinfo+1−1 tests/tables.textile+1
src/pandoc.hs+6−2
@@ -813,6 +813,10 @@ main = do
813813
814814 writerOutput <- writer writerOptions doc''
815815
816+ let writerOutput' = if standalone
817+ then writerOutput
818+ else writerOutput `B.snoc` 10
819+
816820 if outputFile == "-"
817− then B.putStr writerOutput
818− else B.writeFile (encodeString outputFile) writerOutput
821+ then B.putStr writerOutput'
822+ else B.writeFile (encodeString outputFile) writerOutput'
tests/markdown-citations.chicago-author-date.txt+1−1
@@ -40,4 +40,4 @@ Doe, John, and Jenny Roe. 2007. Why Water Is Wet. In *Third Book*, ed. Sam Smith
4040
4141[^2]: Some citations (see Doe 2006, chap. 3; Doe and Roe 2007; Doe 2005).
4242
43−[^3]: Like a citation without author: (2005), and now Doe with a locator (2006, 44).
43+[^3]: Like a citation without author: (2005), and now Doe with a locator (2006, 44).
tests/markdown-citations.ieee.txt+1−1
@@ -40,4 +40,4 @@
4040
4141[^2]: Some citations [1]-[3].
4242
43−[^3]: Like a citation without author: [1], and now Doe with a locator [2].
43+[^3]: Like a citation without author: [1], and now Doe with a locator [2].
tests/markdown-citations.txt+1−1
@@ -34,4 +34,4 @@
3434
3535[^2]: Some citations [see @item2 chap. 3; @item3; @item1].
3636
37−[^3]: Like a citation without author: [-@item1], and now Doe with a locator [-@item2 p. 44].
37+[^3]: Like a citation without author: [-@item1], and now Doe with a locator [-@item2 p. 44].
tests/markdown-reader-more.native+1
@@ -49,3 +49,4 @@ Pandoc (Meta {docTitle = [Str "Title",Space,Str "spanning",Space,Str "multiple",
4949, Header 2 [Str "Curly",Space,Str "smart",Space,Str "quotes"]
5050, Para [Quoted DoubleQuote [Str "Hi"]]
5151, Para [Quoted SingleQuote [Str "Hi"]] ]
52+
tests/s5.fragment.html+1−1
@@ -14,4 +14,4 @@
1414 >$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span
1515 ></li
1616 ></ul
17−>
17+>
tests/tables-rstsubset.native+1
@@ -116,3 +116,4 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
116116 , [ Plain [Str "row"] ]
117117 , [ Plain [Str "5",Str ".",Str "0"] ]
118118 , [ Plain [Str "Here",Str "'",Str "s",Space,Str "another",Space,Str "one",Str ".",Space,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows",Str "."] ] ] ] ]
119+
tests/tables.context+1−1
@@ -172,4 +172,4 @@ Multiline table without column headers:
172172\NC Here's another one. Note the blank line between rows.
173173\NC\AR
174174\HL
175−\stoptable
175+\stoptable
tests/tables.docbook+1−1
@@ -399,4 +399,4 @@
399399 </td>
400400 </tr>
401401 </tbody>
402−</informaltable>
402+</informaltable>
tests/tables.html+1−1
@@ -298,4 +298,4 @@
298298 ></tr
299299 ></tbody
300300 ></table
301−>
301+>
tests/tables.latex+1
@@ -175,3 +175,4 @@ Second
175175\\
176176\end{tabular}
177177\end{center}
178+
tests/tables.man+1−1
@@ -264,4 +264,4 @@ T}@T{
264264Here\[aq]s another one.
265265Note the blank line between rows.
266266T}
267−.TE
267+.TE
tests/tables.markdown+1
@@ -75,3 +75,4 @@ Multiline table without column headers:
7575 rows.
7676 ----------- ---------- ------------ --------------------------
7777
78+
tests/tables.mediawiki+1
@@ -209,3 +209,4 @@ Multiline table without column headers:
209209</tr>
210210</tbody>
211211</table>
212+
tests/tables.native+1
@@ -113,3 +113,4 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
113113 , [ Plain [Str "row"] ]
114114 , [ Plain [Str "5",Str ".",Str "0"] ]
115115 , [ Plain [Str "Here",Str "'",Str "s",Space,Str "another",Space,Str "one",Str ".",Space,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows",Str "."] ] ] ] ]
116+
tests/tables.opendocument+1−1
@@ -393,4 +393,4 @@ headers:</text:p>
393393 blank line between rows.</text:p>
394394 </table:table-cell>
395395 </table:table-row>
396−</table:table>
396+</table:table>
tests/tables.org+1
@@ -49,3 +49,4 @@ Multiline table without column headers:
4949
5050| First | row | 12.0 | Example of a row that spans multiple lines. |
5151| Second | row | 5.0 | Here's another one. Note the blank line between rows. |
52+
tests/tables.plain+1
@@ -75,3 +75,4 @@ Multiline table without column headers:
7575 rows.
7676 ----------- ---------- ------------ --------------------------
7777
78+
tests/tables.rst+1
@@ -88,3 +88,4 @@ Multiline table without column headers:
8888| | | | the blank line between |
8989| | | | rows. |
9090+-------------+------------+--------------+----------------------------+
91+
tests/tables.rtf+1
@@ -357,3 +357,4 @@
357357}
358358\intbl\row}
359359{\pard \ql \f0 \sa180 \li0 \fi0 \par}
360+
tests/tables.texinfo+1−1
@@ -155,4 +155,4 @@ Second
155155 @tab row
156156 @tab 5.0
157157 @tab Here's another one. Note the blank line between rows.
158−@end multitable
158+@end multitable
tests/tables.textile+1
@@ -209,3 +209,4 @@ Multiline table without column headers:
209209</tr>
210210 </tbody>
211211 </table>
212+