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.
This commit is contained in:
John MacFarlane 2011-01-06 21:05:28 -08:00
parent 71bedab81c
commit 93c3e27731
22 changed files with 27 additions and 12 deletions

View file

@ -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'

View file

@ -40,4 +40,4 @@ Doe, John, and Jenny Roe. 2007. Why Water Is Wet. In *Third Book*, ed. Sam Smith
[^2]: Some citations (see Doe 2006, chap. 3; Doe and Roe 2007; Doe 2005).
[^3]: Like a citation without author: (2005), and now Doe with a locator (2006, 44).
[^3]: Like a citation without author: (2005), and now Doe with a locator (2006, 44).

View file

@ -40,4 +40,4 @@
[^2]: Some citations [1]-[3].
[^3]: Like a citation without author: [1], and now Doe with a locator [2].
[^3]: Like a citation without author: [1], and now Doe with a locator [2].

View file

@ -34,4 +34,4 @@
[^2]: Some citations [see @item2 chap. 3; @item3; @item1].
[^3]: Like a citation without author: [-@item1], and now Doe with a locator [-@item2 p. 44].
[^3]: Like a citation without author: [-@item1], and now Doe with a locator [-@item2 p. 44].

View file

@ -49,3 +49,4 @@ Pandoc (Meta {docTitle = [Str "Title",Space,Str "spanning",Space,Str "multiple",
, Header 2 [Str "Curly",Space,Str "smart",Space,Str "quotes"]
, Para [Quoted DoubleQuote [Str "Hi"]]
, Para [Quoted SingleQuote [Str "Hi"]] ]

View file

@ -14,4 +14,4 @@
>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span
></li
></ul
>
>

View file

@ -116,3 +116,4 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
, [ Plain [Str "row"] ]
, [ Plain [Str "5",Str ".",Str "0"] ]
, [ 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 "."] ] ] ] ]

View file

@ -172,4 +172,4 @@ Multiline table without column headers:
\NC Here's another one. Note the blank line between rows.
\NC\AR
\HL
\stoptable
\stoptable

View file

@ -399,4 +399,4 @@
</td>
</tr>
</tbody>
</informaltable>
</informaltable>

View file

@ -298,4 +298,4 @@
></tr
></tbody
></table
>
>

View file

@ -175,3 +175,4 @@ Second
\\
\end{tabular}
\end{center}

View file

@ -264,4 +264,4 @@ T}@T{
Here\[aq]s another one.
Note the blank line between rows.
T}
.TE
.TE

View file

@ -75,3 +75,4 @@ Multiline table without column headers:
rows.
----------- ---------- ------------ --------------------------

View file

@ -209,3 +209,4 @@ Multiline table without column headers:
</tr>
</tbody>
</table>

View file

@ -113,3 +113,4 @@ Pandoc (Meta {docTitle = [], docAuthors = [], docDate = []})
, [ Plain [Str "row"] ]
, [ Plain [Str "5",Str ".",Str "0"] ]
, [ 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 "."] ] ] ] ]

View file

@ -393,4 +393,4 @@ headers:</text:p>
blank line between rows.</text:p>
</table:table-cell>
</table:table-row>
</table:table>
</table:table>

View file

@ -49,3 +49,4 @@ Multiline table without column headers:
| First | row | 12.0 | Example of a row that spans multiple lines. |
| Second | row | 5.0 | Here's another one. Note the blank line between rows. |

View file

@ -75,3 +75,4 @@ Multiline table without column headers:
rows.
----------- ---------- ------------ --------------------------

View file

@ -88,3 +88,4 @@ Multiline table without column headers:
| | | | the blank line between |
| | | | rows. |
+-------------+------------+--------------+----------------------------+

View file

@ -357,3 +357,4 @@
}
\intbl\row}
{\pard \ql \f0 \sa180 \li0 \fi0 \par}

View file

@ -155,4 +155,4 @@ Second
@tab row
@tab 5.0
@tab Here's another one. Note the blank line between rows.
@end multitable
@end multitable

View file

@ -209,3 +209,4 @@ Multiline table without column headers:
</tr>
</tbody>
</table>