v1.0.4 — 2025-06-21 “Unicode Whitespaces & Docs”
Highlights
-
🔒 Robust‑whitespace support
- Added hard‑break handling for
\r,U+0085(NEL),U+2028(LS) andU+2029(PS). - Zero‑width control blanks
\vand\fare now ignored (no stray control bytes in output). - All other Unicode space separators (
U+1680,U+2000–U+200A,U+202F,U+205F,U+3000) are preserved as visible blanks with correctrunewidthaccounting (U+3000= 2 columns).
- Added hard‑break handling for
-
🛡️ Safety fixes
writeTabToLinenow guards againsttabSize == 0; prevents modulo‑zero panic.isWordyGraphemecorrectly classifies combining‑mark‑only clusters.
-
📝 Documentation & API comments
- Expanded docstrings for
StringWrapandStringWrapSplit, clarifying continued use of grapheme parsing for accurate width (e.g., ZWJ emojis). - Added inline commentary detailing whitespace classification logic.
- Expanded docstrings for
-
🧪 New test coverage
- Four fixtures covering legacy whitespace (
\r,U+2028,\v, and long‑word split withU+000B).
- Four fixtures covering legacy whitespace (
-
🔧 Small clean‑ups
- Consolidated whitespace
switch: special‑cases first, singledefaultfor printable blanks. - Eliminated redundant
runewidth.StringWidthcall in theiter()word‑split helper, reducing extra scans on oversized words. - Added performance notes; core algorithm unchanged.
- Consolidated whitespace
No breaking API changes. Previous tag checksums remain valid.