Skip to content

Disallow (@:) syntax in .razor files #7681

@ajaybhargavb

Description

@ajaybhargavb

Repro:

Input:

@if (test)
{
    @:Hello <span>@text</span>
}

@code {
    string text = "world!";
    bool test = true;
}

Generated code:

builder.AddMarkupContent(1, "    Hello <span>");
builder.AddContent(2, text);
builder.AddMarkupContent(3, "</span>\r\n");

Expected Output:

Hello <span>world!</span>

Actual Output:

Hello <span></span> world!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-compilerUmbrella for all compiler issuesbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions