diff --git a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/CSharpCodeParser.cs b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/CSharpCodeParser.cs index 44612ee18c..e63c1dbe90 100644 --- a/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/CSharpCodeParser.cs +++ b/src/Razor/Microsoft.AspNetCore.Razor.Language/src/Legacy/CSharpCodeParser.cs @@ -1356,7 +1356,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy case DirectiveKind.RazorBlock: AcceptWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); SpanContext.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.AllWhitespace; - directiveBuilder.Add(OutputAsMarkupLiteral()); + directiveBuilder.Add(OutputTokensAsUnclassifiedLiteral()); ParseDirectiveBlock(directiveBuilder, descriptor, parseChildren: (childBuilder, startingBraceLocation) => { @@ -1380,7 +1380,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy case DirectiveKind.CodeBlock: AcceptWhile(IsSpacingToken(includeNewLines: true, includeComments: true)); SpanContext.EditHandler.AcceptedCharacters = AcceptedCharactersInternal.AllWhitespace; - directiveBuilder.Add(OutputAsMarkupLiteral()); + directiveBuilder.Add(OutputTokensAsUnclassifiedLiteral()); ParseDirectiveBlock(directiveBuilder, descriptor, parseChildren: (childBuilder, startingBraceLocation) => {