Skip to content

Razor formatting wrong for RenderFragments nested in @{ } block #8228

@LunicLynx

Description

@LunicLynx

This code:

                    @{
                        RenderFragment fragment =
                          @<Component1 Id="Comp1"
                                     Caption="Title">
                        </Component1>;
                    }

Will be incorrectly formatted.

After format the @<Component will be moved to the beginning of the line while the attribute Caption will be aligned with the previous location of the Id attribute.

Note: There are (skipped) tests that cover this scenario in HtmlFormattingTest.cs

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions