File tree 2 files changed +37
-1
lines changed
MarkdownGenerator/Internal/_DocumentSerializer
MarkdownGenerator.Test/Internal/_DocumentSerializer
2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,38 @@ public void Tables_are_serialized_as_expected_02() =>
315
315
new MdTableRow ( "Cell3" , "Cell4" ) ) )
316
316
) ;
317
317
318
+ [ Fact ]
319
+ public void Tables_are_preceded_by_a_blank_line ( ) =>
320
+ AssertToStringEquals (
321
+ "___\r \n " +
322
+ "\r \n " +
323
+ "| Column1 | Column2 |\r \n " +
324
+ "| ------- | ------- |\r \n " +
325
+ "| Cell1 | |\r \n " +
326
+ "| Cell3 | Cell4 |\r \n " ,
327
+ new MdDocument (
328
+ new MdThematicBreak ( ) ,
329
+ new MdTable (
330
+ new MdTableRow ( "Column1" , "Column2" ) ,
331
+ new MdTableRow ( "Cell1" ) ,
332
+ new MdTableRow ( "Cell3" , "Cell4" ) ) ) ) ;
333
+
334
+ [ Fact ]
335
+ public void Tables_are_followed_by_a_blank_line ( ) =>
336
+ AssertToStringEquals (
337
+ "| Column1 | Column2 |\r \n " +
338
+ "| ------- | ------- |\r \n " +
339
+ "| Cell1 | |\r \n " +
340
+ "| Cell3 | Cell4 |\r \n " +
341
+ "\r \n " +
342
+ "___\r \n " ,
343
+ new MdDocument (
344
+ new MdTable (
345
+ new MdTableRow ( "Column1" , "Column2" ) ,
346
+ new MdTableRow ( "Cell1" ) ,
347
+ new MdTableRow ( "Cell3" , "Cell4" ) ) ,
348
+ new MdThematicBreak ( ) ) ) ;
349
+
318
350
[ Fact ]
319
351
public void Serializer_respects_the_TableStyle_serialization_option ( )
320
352
{
Original file line number Diff line number Diff line change @@ -312,6 +312,8 @@ void SaveRow(string[] row)
312
312
m_Writer . WriteLine ( lineBuilder . ToString ( ) ) ;
313
313
}
314
314
315
+ m_Writer . RequestBlankLine ( ) ;
316
+
315
317
// save header row
316
318
SaveRow ( tableAsString [ 0 ] ) ;
317
319
@@ -331,7 +333,9 @@ void SaveRow(string[] row)
331
333
foreach ( var row in tableAsString . Skip ( 1 ) )
332
334
{
333
335
SaveRow ( row ) ;
334
- }
336
+ }
337
+
338
+ m_Writer . RequestBlankLine ( ) ;
335
339
}
336
340
337
341
public void SerializeHtmlTable ( MdTable table )
You can’t perform that action at this time.
0 commit comments