Added test for razor comment between code block and markup (dotnet/aspnetcore-tooling#14)
\n\nCommit migrated from 131003d0c3
This commit is contained in:
parent
ad0f2a5af4
commit
0c71f4f520
|
|
@ -798,6 +798,21 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
|
||||||
|
|
||||||
private void ParseRazorCommentWithLeadingAndTrailingWhitespace(in SyntaxListBuilder<RazorSyntaxNode> builder)
|
private void ParseRazorCommentWithLeadingAndTrailingWhitespace(in SyntaxListBuilder<RazorSyntaxNode> builder)
|
||||||
{
|
{
|
||||||
|
if (Context.NullGenerateWhitespaceAndNewLine)
|
||||||
|
{
|
||||||
|
// Usually this is set to true when a Code block ends and there is whitespace left after it.
|
||||||
|
// We don't want to write it to output.
|
||||||
|
Context.NullGenerateWhitespaceAndNewLine = false;
|
||||||
|
SpanContext.ChunkGenerator = SpanChunkGenerator.Null;
|
||||||
|
AcceptWhile(IsSpacingToken(includeNewLines: false));
|
||||||
|
if (At(SyntaxKind.NewLine))
|
||||||
|
{
|
||||||
|
AcceptAndMoveNext();
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.Add(OutputAsMarkupEphemeralLiteral());
|
||||||
|
}
|
||||||
|
|
||||||
var shouldRenderWhitespace = true;
|
var shouldRenderWhitespace = true;
|
||||||
var lastWhitespace = AcceptWhitespaceInLines();
|
var lastWhitespace = AcceptWhitespaceInLines();
|
||||||
var startOfLine = Context.StartOfLine;
|
var startOfLine = Context.StartOfLine;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue