curb_razor_format_markup

Experimental. With curb_razor_format_code_blocks, also re-indent markup by its nesting, as Microsoft's Razor formatter does. Only indentation changes. Read only from a section that names Razor files.

Value Notes
true
false

Default: false

Experimental, and only on top of curb_razor_format_code_blocks, from a section whose glob names Razor files:

Ini
[*.{razor,cshtml}]
curb_razor_format_code_blocks = true
curb_razor_format_markup = true

Each markup line goes one indent in per element and code block it sits in, as Microsoft's Razor formatter puts it. Only a line's leading whitespace changes; the content of <script>, <style>, <pre> and <textarea>, comments and continued attribute lines stay as written, and a file whose tags do not balance is left alone. See Razor.

Ini
curb_razor_format_markup = true
HTML
<div class="card">
<h3>@Title</h3>
@if (Items.Count > 0)
{
<ul>
@foreach (var item in Items)
{
<li>@item</li>
}
</ul>
}
</div>
HTML
<div class="card">
  <h3>@Title</h3>
  @if (Items.Count > 0)
  {
    <ul>
      @foreach (var item in Items)
      {
        <li>@item</li>
      }
    </ul>
  }
</div>
Ini
curb_razor_format_markup = false
HTML
<div class="card">
<h3>@Title</h3>
@if (Items.Count > 0)
{
<ul>
@foreach (var item in Items)
{
<li>@item</li>
}
</ul>
}
</div>
HTML
<div class="card">
<h3>@Title</h3>
@if (Items.Count > 0)
{
<ul>
@foreach (var item in Items)
{
<li>@item</li>
}
</ul>
}
</div>