Skip to content

v1.0.4

Latest

Choose a tag to compare

@galactixx galactixx released this 21 Jun 22:28
· 6 commits to main since this release

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) and U+2029 (PS).
    • Zero‑width control blanks \v and \f are now ignored (no stray control bytes in output).
    • All other Unicode space separators (U+1680, U+2000U+200A, U+202F, U+205F, U+3000) are preserved as visible blanks with correct runewidth accounting (U+3000 = 2 columns).
  • 🛡️ Safety fixes

    • writeTabToLine now guards against tabSize == 0; prevents modulo‑zero panic.
    • isWordyGrapheme correctly classifies combining‑mark‑only clusters.
  • 📝 Documentation & API comments

    • Expanded docstrings for StringWrap and StringWrapSplit, clarifying continued use of grapheme parsing for accurate width (e.g., ZWJ emojis).
    • Added inline commentary detailing whitespace classification logic.
  • 🧪 New test coverage

    • Four fixtures covering legacy whitespace (\r, U+2028, \v, and long‑word split with U+000B).
  • 🔧 Small clean‑ups

    • Consolidated whitespace switch: special‑cases first, single default for printable blanks.
    • Eliminated redundant runewidth.StringWidth call in the iter() word‑split helper, reducing extra scans on oversized words.
    • Added performance notes; core algorithm unchanged.

No breaking API changes. Previous tag checksums remain valid.