Skip to content

</textarea> doesn’t align #13122

Description

@PhilippJR

It is a Blazor Wasm app.
I created a brand new repo. Please simply clone it, find the following code in Home.razor and hit CTRL+K,D. Among other things, you will see that </textarea> is not being aligned properly.

@* CTRL+K,D indents this comment and the "div", misaligns "oninput", does not align "</textarea>" and does not align the closing "</div>" with the opening "<div>". *@
<div>
    <textarea id="foobarbaz"
              disabled="@(!_bool3)"
              @bind="MyString"
              oninput="if(this.value.includes('\n')) foobarbaz.blur()">
                            </textarea>
</div>

According to @davidwengier

Indenting comment, and “div” and “oninput” [...] seems to be fixed after recent updates. [...] The “</textarea>” doesn’t align is actually by design. The formatter treats the entire contents of a textarea or pre tag as having significant whitespace, and so purposefully doesn’t touch these. I could definitely see this one being debatable, so feel free to log an issue on our repo to change this behaviour..

Source

OS: 10.0.26200.0, VS: 18.5.1 (18.5.11716.220), Product: professional-2026, Project type: C# / Razor editor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions