-
Notifications
You must be signed in to change notification settings - Fork 222
Extra newline no longer rendered at the end of a code block #507
Conversation
@@ -261,6 +261,20 @@ public void ParseDocumentIgnoresTagsInContentsOfScriptTag() | |||
} | |||
|
|||
[Fact] | |||
public void ParseDocumentDoesNotRenderExtraNewLine() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add @{ } <html>\r\n
variation to ensure that the end newline isn't ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
⌚ |
dfd3072
to
743df7a
Compare
Updated. |
{ | ||
PutCurrentBack(); | ||
CompleteBlock(insertMarkerIfNecessary: false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you always complete the block here whether it's nested or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the nested situation we're not null
ing out the SpanKind.Code
's ChunkGenerator
. I think this should be fine but we should validate with debugging (make sure not excess whitespace is highlighted) once a WTE is produced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. The name is misleading here. This CompleteBlock
does nothing here other than EnsureCurrent
and PutCurrentBack
. Removing it affects no tests. I am thinking we should remove it completely.
⌚ |
Updated. |
Factory.Markup("\r\n").With(SpanChunkGenerator.Null), | ||
BlockFactory.MarkupTagBlock("<html>"))); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more tests
@{\r\n} \t\r\n<html>
@{\r\n@if(true){\r\n} <input> }
@{\r\n@if(true){\r\n} \r\n<input> \r\n}<html>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
⌚ |
Updated. |
|
7aa7d84
to
5ef10af
Compare
- #485 - Using a flag to consume whitespace and newline at the end of a verbatim block - Added tests to validate nested blocks
5ef10af
to
e2881b0
Compare
Issue - #485
This fixes the issue with the first example in #485 (comment).
The second example no longer seems to be an issue.
I'm trying various scenarios to see if that issue exists and also to see if this change broke something else. (All tests passing other than the ones updated here)
@NTaylorMullen @dougbu