Moved the comment check into the "ValidateParentAllowsContent" method

This commit is contained in:
Artak Mkrtchyan 2018-02-13 15:58:12 -08:00
parent 7d8d56cc9b
commit b2ae175d39
1 changed files with 2 additions and 2 deletions

View File

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