Thanks to visit codestin.com
Credit goes to github.com

Skip to content

πŸ› Formatting an HTML file from stdin deletes <styles> contentsΒ #8552

@niedzielski

Description

@niedzielski

Environment information

$ npx biome rage
CLI:
  Version:                      2.3.10
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  BIOME_THREADS:                unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v22.6.0
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         npm/10.8.2

Biome Configuration:
  Status:                       Loaded successfully
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  false
  HTML full support enabled:    unset

Workspace:
  Open Documents:               0

What happened?

When I format HTML on stdin, it strips the contents of my <styles> tag.

{
  "$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
  "html": {"formatter": {"enabled": true}}
}
$ echo '<html>
  <body>
    <style>
      div {
        color: red;
      }
    </style>
  </body>
</html>'|npx biome check --fix --stdin-file-path=index.html

<html>
	<body>
		<style></style>
	</body>
</html>

I'm wondering if file type is not being correctly determined from the path.

Expected result

Styles should not be zapped.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-Needs triageStatus: this issue needs to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions