Patch release. No API changes.
- Documented
similarityformula (normalized Levenshtein) - Clarified
striptreatscharsas a set, not a literal - Clarified
ascii_fold_no_decomposevsascii_foldwith examples - Documented
slugify_optsmax_len: -1= no limit - Promoted
charsexperimental warning - Fixed README
fillexample (was showing string"both"instead ofBoth)
Additive release. All existing code continues to work.
New API:
TruncateModetype (Strict | Preserve) replacingtruncate_strict/truncate_preserve/truncate_with_flag— collapses 4 functions into 1SlugifyOptsrecord +slug_withreplacing the positionalslugify_optsvariants — eliminates opaque positional args and combinatorial_with_normalizervariantsstrip_affixesas the canonical name forunwrap—unwrapconflicts with established FP semantics (extract from container or panic)
Deprecations (removed in 3.0):
truncate_strict,truncate_preserve,truncate_default,truncate_with_flagslugify_opts,slugify_with_normalizer,slugify_opts_with_normalizerascii_fold_with_normalizer,ascii_fold_no_decompose_with_normalizerunwrap,index_of_simple,count_simple- KMP/sliding re-exports in
strmain module → usestr/advanceddirectly - Config constant re-exports in
strmain module → usestr/configdirectly
Also:
MIGRATION.mdwith full old → new mappingcharsmoved tostr/tokenizeor renamedapproximate_chars;chars_stdlibbecomes the canonicalchars
Removes everything deprecated in v2.2.0. Users who followed deprecation notices have zero changes to make.
Removed:
- All deprecated truncate variants → only
truncate(3-arg, default behaviour) andtruncate_mode(4-arg withTruncateMode) remain - All deprecated slugify/ascii_fold variants →
slugify,slug_with,ascii_fold,ascii_fold_no_decomposeremain unwrap→strip_affixesindex_of_simple,count_simple- KMP/sliding/config re-exports from
strmain module - Legacy modules
str/core,str/extra,str/tokenize(deprecated since 2.0)
API surface goal: str.gleam exposes only user-facing operations.
Algorithm plumbing lives exclusively in str/advanced. Configuration in
str/config. No internals leaking through the main module.