Skip to content

V2.1

Latest

Choose a tag to compare

@deanhume deanhume released this 27 Jul 10:25
· 24 commits to master since this release

🐛 Bug fixes

Preserve original file encoding (non-Unicode / Windows-1251) — #62
Files encoded in a non-Unicode codepage (e.g. Windows-1251 Cyrillic) were being read and rewritten as UTF-8, corrupting every non-ASCII character into  �  replacement characters. The minifier now detects the source encoding — via a byte-order mark, then a    declaration, falling back to UTF-8 — and writes the file back in that same encoding, preserving any BOM. Encoding detection lives in the new  EncodingHelper  class.

Preserve significant whitespace between adjacent inline elements — #59
A space between two inline elements (for example, two links:    ) is visible and meaningful, but was being stripped, gluing the elements together ( https://a.infohttps://b.de ). Whitespace directly between a closing inline tag and an opening inline tag ( a ,  span ,  b ,  i ,  em ,  strong ,  code ,  label , and other inline elements) is now collapsed to a single space instead of being removed. Whitespace at block↔inline boundaries is unchanged.

✅ Notes

• No breaking changes or new CLI flags.
• Full test suite green (83 tests), including new regression tests  GithubIssue62_ShouldReturnCorrectly  and  GithubIssue59_ShouldReturnCorrectly .