Don't render text tags for component documents (dotnet/aspnetcore-tooling#391)

\n\nCommit migrated from cb6f5d0dc7
This commit is contained in:
Ajay Bhargav Baaskaran 2019-04-06 19:46:24 -07:00 committed by GitHub
parent 7957c11d02
commit 607f64b386
1 changed files with 9 additions and 0 deletions

View File

@ -1148,6 +1148,15 @@ namespace Microsoft.AspNetCore.Razor.Language
public override void VisitMarkupElement(MarkupElementSyntax node)
{
if ((node.StartTag != null && node.StartTag.IsMarkupTransition) ||
(node.EndTag != null && node.EndTag.IsMarkupTransition))
{
// We don't want to create a node for Markup transitions (<text></text>). Treat their contents as regular markup.
// Technically there shouldn't be an end transition without a start transition but just being defensive.
base.VisitMarkupElement(node);
return;
}
var element = new MarkupElementIntermediateNode()
{
Source = BuildSourceSpanFromNode(node),