Files
dioxus/packages/autofmt/tests/samples/blank_lines_preserved.rsx
T
hideselfviewandDmitry Minkovsky 3a60140dff fix: prevent dx fmt from adding trailing whitespace to blank lines (#5224)
This fixes a conflict between dx fmt and cargo fmt (rustfmt). Previously,
dx fmt would add indentation whitespace to blank lines inside RSX blocks,
but cargo fmt removes trailing whitespace from all lines. This made it
impossible for code to satisfy both formatters.

The fix skips adding indentation to empty lines in two places:
1. When indenting formatted RSX blocks inside expressions
2. When reassembling the final formatted output

Fixes #5223

Co-authored-by: Dmitry Minkovsky <dminkovsky@gmail.com>
2026-01-16 15:47:47 -08:00

10 lines
90 B
R

rsx! {
div {
span { "a" }
span { "b" }
span { "c" }
}
}