diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs index 73b545dd33..f046a8eea4 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs @@ -488,7 +488,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy private void ValidateParentAllowsContent(Span child, ErrorSink errorSink) { - if (child.Kind == SpanKindInternal.Comment || HasAllowedChildren()) + if (HasAllowedChildren()) { var content = child.Content; if (!string.IsNullOrWhiteSpace(content))