From a940a4cd919330405d0ff221c691497edc245385 Mon Sep 17 00:00:00 2001 From: Artak Mkrtchyan Date: Tue, 13 Feb 2018 15:58:12 -0800 Subject: [PATCH] Moved the comment check into the "ValidateParentAllowsContent" method --- .../Legacy/TagHelperParseTreeRewriter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs index 01361a9893..930b928949 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/TagHelperParseTreeRewriter.cs @@ -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))