@@ -305,6 +305,21 @@ public void ParseDocumentDoesNotRenderExtraNewLineAtTheEndOfVerbatimBlock()
305
305
BlockFactory . MarkupTagBlock ( "<html>" ) ) ) ;
306
306
}
307
307
308
+ [ Fact ]
309
+ public void ParseDocumentDoesNotRenderExtraWhitespaceAndNewLineAtTheEndOfVerbatimBlock ( )
310
+ {
311
+ ParseDocumentTest ( "@{\r \n } \t \r \n <html>" ,
312
+ new MarkupBlock (
313
+ Factory . EmptyHtml ( ) ,
314
+ new StatementBlock (
315
+ Factory . CodeTransition ( ) ,
316
+ Factory . MetaCode ( "{" ) . Accepts ( AcceptedCharacters . None ) ,
317
+ Factory . Code ( "\r \n " ) . AsStatement ( ) . AutoCompleteWith ( null , false ) ,
318
+ Factory . MetaCode ( "}" ) . Accepts ( AcceptedCharacters . None ) ) ,
319
+ Factory . Markup ( " \t \r \n " ) . With ( SpanChunkGenerator . Null ) ,
320
+ BlockFactory . MarkupTagBlock ( "<html>" ) ) ) ;
321
+ }
322
+
308
323
[ Fact ]
309
324
public void ParseDocumentDoesNotIgnoreNewLineAtTheEndOfMarkupBlock ( )
310
325
{
@@ -356,6 +371,53 @@ public void ParseDocumentHandlesNewLineInNestedBlock()
356
371
BlockFactory . MarkupTagBlock ( "<html>" ) ) ) ;
357
372
}
358
373
374
+ [ Fact ]
375
+ public void ParseDocumentHandlesNewLineAndMarkupInNestedBlock ( )
376
+ {
377
+ ParseDocumentTest ( "@{\r \n @if(true){\r \n } <input> }" ,
378
+ new MarkupBlock (
379
+ Factory . EmptyHtml ( ) ,
380
+ new StatementBlock (
381
+ Factory . CodeTransition ( ) ,
382
+ Factory . MetaCode ( "{" ) . Accepts ( AcceptedCharacters . None ) ,
383
+ Factory . Code ( "\r \n " ) . AsStatement ( ) . AutoCompleteWith ( null , false ) ,
384
+ new StatementBlock (
385
+ Factory . CodeTransition ( ) ,
386
+ Factory . Code ( "if(true){\r \n }" ) . AsStatement ( ) ) ,
387
+ new MarkupBlock (
388
+ Factory . Markup ( " " ) ,
389
+ new MarkupTagBlock (
390
+ Factory . Markup ( "<input>" ) . Accepts ( AcceptedCharacters . None ) ) ,
391
+ Factory . Markup ( " " ) . Accepts ( AcceptedCharacters . None ) ) ,
392
+ Factory . EmptyCSharp ( ) . AsStatement ( ) ,
393
+ Factory . MetaCode ( "}" ) . Accepts ( AcceptedCharacters . None ) ) ,
394
+ Factory . EmptyHtml ( ) ) ) ;
395
+ }
396
+
397
+ [ Fact ]
398
+ public void ParseDocumentHandlesExtraNewLineBeforeMarkupInNestedBlock ( )
399
+ {
400
+ ParseDocumentTest ( "@{\r \n @if(true){\r \n } \r \n <input> \r \n }<html>" ,
401
+ new MarkupBlock (
402
+ Factory . EmptyHtml ( ) ,
403
+ new StatementBlock (
404
+ Factory . CodeTransition ( ) ,
405
+ Factory . MetaCode ( "{" ) . Accepts ( AcceptedCharacters . None ) ,
406
+ Factory . Code ( "\r \n " ) . AsStatement ( ) . AutoCompleteWith ( null , false ) ,
407
+ new StatementBlock (
408
+ Factory . CodeTransition ( ) ,
409
+ Factory . Code ( "if(true){\r \n }" ) . AsStatement ( ) ) ,
410
+ Factory . Code ( " \r \n " ) . AsStatement ( ) ,
411
+ new MarkupBlock (
412
+ new MarkupTagBlock (
413
+ Factory . Markup ( "<input>" ) . Accepts ( AcceptedCharacters . None ) ) ,
414
+ Factory . Markup ( " \r \n " ) . Accepts ( AcceptedCharacters . None ) ) ,
415
+ Factory . EmptyCSharp ( ) . AsStatement ( ) ,
416
+ Factory . MetaCode ( "}" ) . Accepts ( AcceptedCharacters . None ) ) ,
417
+ new MarkupTagBlock (
418
+ Factory . Markup ( "<html>" ) ) ) ) ;
419
+ }
420
+
359
421
[ Fact ]
360
422
public void ParseSectionIgnoresTagsInContentsOfScriptTag ( )
361
423
{
0 commit comments