Skip to content

Void end tag is missing from the syntax tree if a void tag is targeted by a tag helper with WithoutEndTag structure #6469

@ajaybhargavb

Description

@ajaybhargavb

Consider,
<input></input>
Input is targeted by a tag helper with TagStructure.WithoutEndTag

Expected:
<input> is parsed as a tag helper and </input> is parsed as a regular tag with a missing start tag.

RazorDocument - [0..15)::15 - [<input></input>]
    MarkupBlock - [0..15)::15
        MarkupElement - [0..15)::15
            MarkupTagHelperElement - [0..7)::7 - input[StartTagOnly] - InputTagHelper1 - InputTagHelper2
                MarkupTagHelperStartTag - [0..7)::7
                    MarkupTextLiteral - [0..6)::6 - [<input] - Gen<Markup> - SpanEditHandler;Accepts:Any
                        OpenAngle;[<];
                        Text;[input];
                    MarkupTextLiteral - [6..7)::1 - [>] - Gen<Markup> - SpanEditHandler;Accepts:Any
                        CloseAngle;[>];
            MarkupEndTag - [7..15)::8 - [</input>] - Gen<Markup> - SpanEditHandler;Accepts:Any
                OpenAngle;[<];
                ForwardSlash;[/];
                Text;[input];
                CloseAngle;[>];

Actual:
<input> is parsed as a tag helper and </input> is totally missing from the rewritten syntax tree

RazorDocument - [0..7)::7 - [<input>]
    MarkupBlock - [0..7)::7
        MarkupTagHelperElement - [0..7)::7 - input[StartTagOnly] - InputTagHelper1 - InputTagHelper2
            MarkupTagHelperStartTag - [0..7)::7
                MarkupTextLiteral - [0..6)::6 - [<input] - Gen<Markup> - SpanEditHandler;Accepts:Any
                    OpenAngle;[<];
                    Text;[input];
                MarkupTextLiteral - [6..7)::1 - [>] - Gen<Markup> - SpanEditHandler;Accepts:Any
                    CloseAngle;[>];

Metadata

Metadata

Assignees

Labels

area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templatesbugThis issue describes a behavior which is not expected - a bug.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions