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:
parent
71bedab81c
commit
93c3e27731
22 changed files with 27 additions and 12 deletions
|
@ -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'
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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].
|
||||
|
|
|
@ -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].
|
||||
|
|
|
@ -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"]] ]
|
||||
|
||||
|
|
|
@ -14,4 +14,4 @@
|
|||
>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span
|
||||
></li
|
||||
></ul
|
||||
>
|
||||
>
|
||||
|
|
|
@ -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 "."] ] ] ] ]
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -399,4 +399,4 @@
|
|||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</informaltable>
|
||||
</informaltable>
|
||||
|
|
|
@ -298,4 +298,4 @@
|
|||
></tr
|
||||
></tbody
|
||||
></table
|
||||
>
|
||||
>
|
||||
|
|
|
@ -175,3 +175,4 @@ Second
|
|||
\\
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
|
|
|
@ -264,4 +264,4 @@ T}@T{
|
|||
Here\[aq]s another one.
|
||||
Note the blank line between rows.
|
||||
T}
|
||||
.TE
|
||||
.TE
|
||||
|
|
|
@ -75,3 +75,4 @@ Multiline table without column headers:
|
|||
rows.
|
||||
----------- ---------- ------------ --------------------------
|
||||
|
||||
|
||||
|
|
|
@ -209,3 +209,4 @@ Multiline table without column headers:
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -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 "."] ] ] ] ]
|
||||
|
||||
|
|
|
@ -393,4 +393,4 @@ headers:</text:p>
|
|||
blank line between rows.</text:p>
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
</table:table>
|
||||
</table:table>
|
||||
|
|
|
@ -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. |
|
||||
|
||||
|
|
|
@ -75,3 +75,4 @@ Multiline table without column headers:
|
|||
rows.
|
||||
----------- ---------- ------------ --------------------------
|
||||
|
||||
|
||||
|
|
|
@ -88,3 +88,4 @@ Multiline table without column headers:
|
|||
| | | | the blank line between |
|
||||
| | | | rows. |
|
||||
+-------------+------------+--------------+----------------------------+
|
||||
|
||||
|
|
|
@ -357,3 +357,4 @@
|
|||
}
|
||||
\intbl\row}
|
||||
{\pard \ql \f0 \sa180 \li0 \fi0 \par}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -209,3 +209,4 @@ Multiline table without column headers:
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue