markup_fmt
markup_fmt copied to clipboard
Unexpectedly dedents Astro HTML subexpression inside deep JavaScript expression
When formatting an Astro file with an HTML subexpression inside a deep JavaScript expression, markup_fmt incorrectly ignores the indentation that represents the JavaScript depth, and instead dedents all the HTML subexpressions to the same level, making complicated expressions harder to read.
Expected:
{
1
? 2
? 3
? 4
? (
<p>
all
</p>
)
: (
<p>
not four
</p>
)
: (
<p>
not three
</p>
)
: (
<p>
not two
</p>
)
: (
<p>
not one
</p>
)
}
Actual:
{
1
? 2
? 3
? 4
? (
<p>
all
</p>
)
: (
<p>
not four
</p>
)
: (
<p>
not three
</p>
)
: (
<p>
not two
</p>
)
: (
<p>
not one
</p>
)
}
Or maybe something even stranger is going on.
Expected:
{
1
? [
"a",
"b",
(
<p>
c
</p>
),
"d",
"e",
(
<p>
f
</p>
),
"g",
"h",
(
<p>
i
</p>
),
"j",
"k",
]
: []
}
Actual:
{
1
? [
"a",
"b",
(
<p>
c
</p>
),
"d",
"e",
(
<p>
f
</p>
),
"g",
"h",
(
<p>
i
</p>
),
"j",
"k",
]
: []
}