-
-
Notifications
You must be signed in to change notification settings - Fork 760
Labels
A-FormatterArea: formatterArea: formatterL-HTMLLanguage: HTML and super languagesLanguage: HTML and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug
Milestone
Description
Environment information
CLI:
Version: 2.3.2
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_CONFIG_PATH: unset
BIOME_THREADS: unset
NO_COLOR: unset
TERM: xterm-ghostty
JS_RUNTIME_VERSION: v22.12.0
JS_RUNTIME_NAME: node
NODE_PACKAGE_MANAGER: pnpm/10.6.5
Biome Configuration:
Status: Loaded successfully
Path: biome.json
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: true
Workspace:
Open Documents: 0
What happened?
- Unexpected result of formatting space in
html/html-ishfiles. Whitespace is removed after inline elements within a<p>tag when"whitespaceSensitivity": "strict"is enabled.
<p>
Lorem, ipsum dolor sit amet <span>consectetur</span> adipisicing elit.
</p>
<!--
Moving subsequent text to newline preserves whitespace.
-->
<p>
Lorem, ipsum dolor sit amet <span>consectetur</span>
adipisicing elit.
</p>- The following output is observed for the 1st case above. Whitespace is removed after the closing tag.
<p>
Lorem, ipsum dolor sit amet <span>consectetur</span>adipisicing elit.
</p>// biome.json
{
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
"html": {
"experimentalFullSupportEnabled": true,
"formatter": {
"enabled": true,
"indentScriptAndStyle": true,
"whitespaceSensitivity": "strict"
}
},
}Expected result
Expected formatting with strict whitespaceSensitivity:
<p>
Lorem, ipsum dolor sit amet <span>consectetur</span> adipisicing elit.
</p>Code of Conduct
- I agree to follow Biome's Code of Conduct
Metadata
Metadata
Assignees
Labels
A-FormatterArea: formatterArea: formatterL-HTMLLanguage: HTML and super languagesLanguage: HTML and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug