GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — Preserve the BOM when stringifying by hdimer · Pull Request #2119 · postcss/postcss Conversation
Contributor
PostCSS aims for byte-to-byte equal output, but the stringifier drops a leading byte order mark: postcss.parse('a{color:red}').toString() // => 'a{color:red}', BOM lost The BOM is already detected ( This emits the BOM in Disclosure: written with AI assistance (Claude Code); I reviewed it and verified against the full suite (unit, eslint, check-dts, size-limit all pass, incl. the newly re-enabled test).
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsPostCSS aims for byte-to-byte equal output, but the stringifier dropped a
leading byte order mark: `parse('a{}').toString()` returned `a{}`. The
BOM is already detected (`Input#hasBOM`) but was never re-emitted, so the
`bom.css` round-trip test had to be skipped.
Emit the BOM in `Stringifier#root` when the source had one, and re-enable the
previously skipped test.
Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
Released in 8.5.24. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Interesting why BOM was stripped before? Because now this change breaks application production builds where SASS is in chain. Sass by default has We had to downgrade to v @ai What are your thoughts? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It was a mistake (we forgot about it). BOM is a well expected symbol. It is a big issue of the parser if it can't process it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So you want to say that this is browsers (Chrome, Firefox, ...) bug that they do not parse BOM properly in inline styles? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
No, BOM should be only in the begging of the file. It is bug on inliner tool to not remove BOM in this case. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PostCSS aims for byte-to-byte equal output, but the stringifier dropped a
leading byte order mark: `parse('a{}').toString()` returned `a{}`. The
BOM is already detected (`Input#hasBOM`) but was never re-emitted, so the
`bom.css` round-trip test had to be skipped.
Emit the BOM in `Stringifier#root` when the source had one, and re-enable the
previously skipped test.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.