Moved the comment check into the "ValidateParentAllowsContent" method

This commit is contained in:
Artak Mkrtchyan 2018-02-13 15:58:12 -08:00
parent 679acdc5d4
commit a940a4cd91
No known key found for this signature in database
GPG Key ID: 64D580ACBA8CA645
1 changed files with 2 additions and 2 deletions

View File

@ -116,7 +116,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
continue;
}
}
else if (!IsComment((Span)child))
else
{
ValidateParentAllowsContent((Span)child, errorSink);
}
@ -488,7 +488,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy
private void ValidateParentAllowsContent(Span child, ErrorSink errorSink)
{
if (HasAllowedChildren())
if (HasAllowedChildren() && !IsComment(child))
{
var content = child.Content;
if (!string.IsNullOrWhiteSpace(content))